Skip to content

Instantly share code, notes, and snippets.

@yury-sannikov
Last active September 22, 2017 17:37
Show Gist options
  • Save yury-sannikov/9675176ad442396dbf0f41f021f7a06b to your computer and use it in GitHub Desktop.
Save yury-sannikov/9675176ad442396dbf0f41f021f7a06b to your computer and use it in GitHub Desktop.
mocha-aura test class overview
const helper = require('aura/FormFields/FormFieldsHelper');
@isTest
class FormFieldsController {
@runBefore
before() {
global.$A = auraFactory();
this.sandbox = sinon.sandbox.create();
global.document = {getElementById: () => {} }
}
@runAfter
after() {
delete global.$A;
delete global.document;
}
@runBeforeEach
beforeEach() {
this.sandbox.stub(helper)
}
@runAfterEach
afterEach() {
this.sandbox.restore()
}
//...
}
classyRegister(FormFieldsController);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment