Skip to content
This repository was archived by the owner on Oct 21, 2021. It is now read-only.
This repository was archived by the owner on Oct 21, 2021. It is now read-only.

Cannot display real source code inside mocha #14

Description

@wintercounter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions