-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
v4 Unit Tests
Chad Engler edited this page Jul 12, 2017
·
1 revision
Tests are written in Mocha, while the tests support ES6 features, it's important to retain the Mocha scope when writing tests. Avoid the use of fat-arrows. For instance:
describe('ClassName', function() {
it('methodName1', () => { // incorrect
// cannot use "this" for Mocha API
});
it('methodName', function() { // correct
this.timeout(4000); // preserve Mocha scope
});
});
Version 7
Version 6
Version 5
Version 4