Skip to content
This repository was archived by the owner on Dec 22, 2020. It is now read-only.

Commit efc9ebf

Browse files
obezukTim Obezuk
authored and
Tim Obezuk
committed
Added support for Web Worker
1 parent a06194d commit efc9ebf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ module.exports.pitch = function pitch(req) {
4444
);
4545
source.push(`mocha.addFile(${JSON.stringify(`!!${req}`)});`);
4646
source.push('mocha.watch();');
47+
} else if (this.target === 'webworker') {
48+
source.push(`mocha.setup({"ui" : "bdd", "reporter": "json"});`);
49+
source.push(`global.location = { search: '' };`);
50+
source.push(`require(${JSON.stringify(`!!${req}`)})`);
4751
} else {
4852
throw new Error(`Unsupported target environment ${this.target}`);
4953
}

0 commit comments

Comments
 (0)