Created
March 6, 2017 22:06
-
-
Save gauntface/899ba1f46c3daa0808d9409db9a518ac to your computer and use it in GitHub Desktop.
Example browser test that registers a service worker file that will contain JS Unit Tests
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
| describe('Run SW Unit Tests', function() { | |
| beforeEach(function() { | |
| return window.__testCleanup(); | |
| }); | |
| after(function() { | |
| return window.__testCleanup(); | |
| }); | |
| it('should run sw-unit-tests.js unit tests', function() { | |
| return navigator.serviceWorker.register('/test/sw/sw-unit-tests.js') | |
| .then((reg) => { | |
| return window.__waitForSWState(reg, 'activated'); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment