Created
March 6, 2017 22:06
-
-
Save gauntface/5384a1631eea66b9e6c97e0df0c93c99 to your computer and use it in GitHub Desktop.
An example of Mocha running in a service worker / web worker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| importScripts('/node_modules/mocha/mocha.js'); | |
| mocha.setup({ | |
| ui: 'bdd', | |
| reporter: null, | |
| }); | |
| describe('First SW Test Suite', function() { | |
| it('should test something', function() { | |
| ... | |
| }); | |
| }); | |
| const runResults = mocha.run(); | |
| runResults.on('end', () => { | |
| console.log(`${runResults.failures} out of ${runResults.total} failures.`); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment