build: remove main() from specs (#21053)

PR Close #21053
This commit is contained in:
Misko Hevery
2017-12-16 14:42:55 -08:00
committed by Igor Minar
parent 47bcb5bc35
commit 47e251a80a
191 changed files with 424 additions and 424 deletions

View File

@ -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({

View File

@ -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;

View File

@ -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;
});
});
}
})();

View File

@ -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> {

View File

@ -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> {

View File

@ -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);
});
});
}
})();

View File

@ -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);