-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
62 lines (53 loc) · 1.63 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<html>
<head>
<meta charset="utf-8">
<title>SW Toolbox Tests</title>
<link href="/node_modules/mocha/mocha.css" rel="stylesheet" />
<!--
iframes are used to manage service worker scoping.
This will hide them and stop the page from jumping around
-->
<style>
iframe {
width: 0;
height: 0;
}
</style>
</head>
<body>
<div id="mocha"></div>
<script src="/node_modules/chai/chai.js"></script>
<script src="/node_modules/mocha/mocha.js"></script>
<script src="/node_modules/localforage/dist/localforage.min.js"></script>
<script src="/dist/mole_fetch.js"></script>
<!-- sw-testing-helpers -->
<script src="/node_modules/sw-testing-helpers/browser/mocha-utils.js"></script>
<script src="/node_modules/sw-testing-helpers/browser/sw-utils.js"></script>
<script>mocha.setup({
ui: 'bdd',
timeout: 5000
})</script>
<script>
(function() {
if (!('serviceWorker' in navigator)) {
publishTestResults();
return;
}
// We unregister all service workers, clear all caches and remove
// All registered iframes
beforeEach(function() {
// This clears a cookie set by the server for redirects
document.cookie = 'bouncedRedirect=; expires=' + new Date().getTime() + ';path=/';
return window.goog.swUtils.cleanState();
});
// should adds objects to protyptes which requires this call to be made
// before any tests are run.
window.chai.should();
window.goog.mochaUtils.startInBrowserMochaTests()
.then(results => {
window.testsuite = results;
});
})();
</script>
</body>
</html>