This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { auraFactory, eventFactory } = require('mocha-aura/aura') | |
describe('Component Controller', () => { | |
let sandbox, clock; | |
before(() => { | |
global.$A = auraFactory({ | |
// Define all your labels you're using in a test suite | |
'$Label.c.My_Label': 'My_Label', | |
// Define all global events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { apexCallFactory, apexErrorResult, apexSuccessResult, componentFactory } = require('mocha-aura/aura') | |
const helper = require('path/to/aura/helper') | |
describe('Apex Call Test', () => { | |
it('should set component v.object to Apex result', apexTest(false)); | |
it('should set v.error if Apex call failed', apexTest(true)); | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let clock; | |
before(function() { | |
clock = sinon.useFakeTimers(); | |
}); | |
describe('Create Component', function() { | |
it('should create component after timeout of 500 ms', function() { | |
// Make helper call which uses setTimeout(..., 500) to call GlobalHelper.showLoadedData() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (event.getParam('panelId') === this.PANELS.INFO) { | |
if (event.getParam('id') === component.get('v.id')) { | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poolForChanges(so) { | |
// Prepare environment | |
const component = componentFactory({}); | |
const callback = sinon.spy(); | |
// Invoke component helper method | |
helper.poolForChanges(component, callback); | |
// helper method should call another helper method. | |
// It's second parameter has a callback we are going to test | |
expect(helper.pullSummary).to.have.been.called; | |
const [{args: [,pullTicketSummaryCallback]}] = helper.pullSummary.getCalls(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inputFieldAdapter.js | |
const sinon = require('sinon'); | |
exports.inputFieldAdapter = function inputFieldAdapter(componentInstance, params = {}) { | |
const setParam = (cmp, name, value) => cmp.params[name] = params.hasOwnProperty(name) ? params[name] : value; | |
// Set default property values on a component instance | |
setParam(componentInstance, 'label', ''); | |
setParam(componentInstance, 'fieldType', ''); | |
... | |
// Add component-specific methods on component instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cuda:8.0-cudnn7-devel | |
RUN apt-get update && \ | |
apt-get -y dist-upgrade && \ | |
apt-get -y install \ | |
kmod \ | |
make \ | |
build-essential \ | |
cmake \ | |
cpp \ | |
g++ \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Ethereum Cluster VPC with two availability zones' | |
Metadata: | |
'AWS::CloudFormation::Interface': | |
ParameterGroups: | |
- Label: | |
default: 'VPC Parameters' | |
Parameters: | |
- ClassB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"taskDefinition": { | |
"status": "ACTIVE", | |
"networkMode": "bridge", | |
"family": "gpu-docker", | |
"placementConstraints": [], | |
"volumes": [], | |
"taskDefinitionArn": "arn:aws:ecs:us-east-1:217509956792:task-definition/ethminer-docker:1", | |
"containerDefinitions": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Creates environment for running GPU workload on EC2 Container Service | |
Parameters: | |
ECSInstanceType: | |
AllowedValues: [g2.2xlarge, g2.8xlarge, p2.xlarge, p2.8xlarge, p2.16xlarge] | |
ConstraintDescription: Must be g2.2xlarge, g2.8xlarge, p2.xlarge, p2.8xlarge, | |
p2.16xlarge | |
Default: g2.2xlarge | |
Description: ECS instance type | |
Type: String |
OlderNewer