-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
None
There are a bunch of things we tend to do a lot for our tests that could be combined into a single location at test/runner/index.js.
Items that come to mind are:
- Creating a sinon sandbox that resets after each test
- Using certain chai plugins like chai-subset.
- Setting certain chai config flags
Something like the following would be nice:
const chai = require('chai'); chai.use(require('chai-subset')); chai.config.includeStack = true; chai.config.showDiff = true; chai.config.truncateThreshold = 0; before(function() { this.sinon = sinon.sandbox.create(); // not sure about this one, but it could be useful to avoid pulling in expect at the top of each file. this.expect = chai.expect; }); afterEach(function() { this.sinon.restore(); });