@ -9,7 +9,7 @@
|
||||
import {Generator} from '../src/generator';
|
||||
import {MockFilesystem} from '../testing/mock';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Generator', () => {
|
||||
it('generates a correct config', (done: DoneFn) => {
|
||||
const fs = new MockFilesystem({
|
||||
|
@ -14,7 +14,7 @@ import {SwPush} from '../src/push';
|
||||
import {SwUpdate} from '../src/update';
|
||||
import {MockServiceWorkerContainer, MockServiceWorkerRegistration} from '../testing/mock';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('ServiceWorker library', () => {
|
||||
let mock: MockServiceWorkerContainer;
|
||||
let comm: NgswCommChannel;
|
||||
|
@ -65,7 +65,7 @@ const server = new MockServerStateBuilder().withStaticFiles(dist).withManifest(m
|
||||
const serverUpdate =
|
||||
new MockServerStateBuilder().withStaticFiles(distUpdate).withManifest(manifestUpdate).build();
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
// Skip environments that don't support the minimum APIs needed to run the SW tests.
|
||||
if (!SwTestHarness.envIsSupported()) {
|
||||
return;
|
||||
@ -129,4 +129,4 @@ export function main() {
|
||||
await gotPushNotice;
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -114,7 +114,7 @@ function asyncWrap(fn: () => Promise<void>): (done: DoneFn) => void {
|
||||
return (done: DoneFn) => { fn().then(() => done(), err => done.fail(err)); };
|
||||
}
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
// Skip environments that don't support the minimum APIs needed to run the SW tests.
|
||||
if (!SwTestHarness.envIsSupported()) {
|
||||
return;
|
||||
@ -242,7 +242,7 @@ export function main() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
async function makeRequest(scope: SwTestHarness, url: string, clientId?: string):
|
||||
Promise<string|null> {
|
||||
|
@ -139,7 +139,7 @@ const scope = new SwTestHarnessBuilder().withServerState(server).build();
|
||||
const manifestHash = sha1(JSON.stringify(manifest));
|
||||
const manifestUpdateHash = sha1(JSON.stringify(manifestUpdate));
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
// Skip environments that don't support the minimum APIs needed to run the SW tests.
|
||||
if (!SwTestHarness.envIsSupported()) {
|
||||
return;
|
||||
@ -674,7 +674,7 @@ export function main() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
async function makeRequest(
|
||||
scope: SwTestHarness, url: string, clientId?: string, init?: Object): Promise<string|null> {
|
||||
|
@ -10,7 +10,7 @@ import {IdleScheduler} from '../src/idle';
|
||||
import {SwTestHarness, SwTestHarnessBuilder} from '../testing/scope';
|
||||
import {async_beforeEach, async_fit, async_it} from './async';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
// Skip environments that don't support the minimum APIs needed to run the SW tests.
|
||||
if (!SwTestHarness.envIsSupported()) {
|
||||
return;
|
||||
@ -134,4 +134,4 @@ export function main() {
|
||||
expect(completed).toEqual(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
@ -29,7 +29,7 @@ const db = new CacheDatabase(scope, scope);
|
||||
|
||||
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
// Skip environments that don't support the minimum APIs needed to run the SW tests.
|
||||
if (!SwTestHarness.envIsSupported()) {
|
||||
return;
|
||||
@ -86,7 +86,7 @@ export function main() {
|
||||
expect(err.message).toContain('Hash mismatch');
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
function errorFrom(promise: Promise<any>): Promise<any> {
|
||||
return promise.catch(err => err);
|
||||
|
Reference in New Issue
Block a user