I've got test-bed set up and it works quite well. I've wrote some tests using async/await. Unfortunately, it shows only the transpiled code in mocha. Then I added babel-plugin-istanbul to the project, and now I also get coverage's code in mocha.
Examples:
// IN
it('should play a beep', () => {
sound.playSound();
assert.isFalse(audioEl.paused, 'is not playing');
});
// OUT
++cov_2d2ry0wax2.f[4];
++cov_2d2ry0wax2.s[8];
sound.playSound();
++cov_2d2ry0wax2.s[9];
assert.isFalse(audioEl.paused, 'is not playing');
// IN
it('should have stopped', async () => {
await stopPromise;
assert.isTrue(audioEl.paused, 'is not stopped');
});
// OUT
var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); });
I've already tried to play around with the configs in createServer.js, nothing worked so far. Can someone please point me into the right direction?
Here is my webpack.config.test.js file: https://pastebin.com/SWzkDjwV
I've got test-bed set up and it works quite well. I've wrote some tests using async/await. Unfortunately, it shows only the transpiled code in mocha. Then I added
babel-plugin-istanbulto the project, and now I also get coverage's code in mocha.Examples:
I've already tried to play around with the configs in
createServer.js, nothing worked so far. Can someone please point me into the right direction?Here is my
webpack.config.test.jsfile: https://pastebin.com/SWzkDjwV