diff --git a/src/TestApp.ts b/src/TestApp.ts index dd2333a..3aa39bd 100644 --- a/src/TestApp.ts +++ b/src/TestApp.ts @@ -48,8 +48,8 @@ export default class TestApp extends Application { private readonly addr: string; private readonly port: number; - public constructor(addr: string, port: number) { - super(packageJson.version, true); + public constructor(addr: string, port: number, ignoreCommandLine: boolean = false) { + super(packageJson.version, ignoreCommandLine); this.addr = addr; this.port = port; } diff --git a/test/Authentication.test.ts b/test/Authentication.test.ts index fff1ef0..6233458 100644 --- a/test/Authentication.test.ts +++ b/test/Authentication.test.ts @@ -34,7 +34,7 @@ useApp(async (addr, port) => { await super.init(); } - }(addr, port); + }(addr, port, true); }); let agent: supertest.SuperTest; diff --git a/test/AuthenticationNoUsername.test.ts b/test/AuthenticationNoUsername.test.ts index 8930d7d..ba7239d 100644 --- a/test/AuthenticationNoUsername.test.ts +++ b/test/AuthenticationNoUsername.test.ts @@ -37,7 +37,7 @@ useApp(async (addr, port) => { protected getMigrations(): MigrationType[] { return super.getMigrations().filter(m => m !== AddNameToUsersMigration); } - }(addr, port); + }(addr, port, true); }); let agent: supertest.SuperTest; diff --git a/test/CsrfProtectionComponent.test.ts b/test/CsrfProtectionComponent.test.ts index f83a5cb..1cc82f7 100644 --- a/test/CsrfProtectionComponent.test.ts +++ b/test/CsrfProtectionComponent.test.ts @@ -24,7 +24,7 @@ useApp(async (addr, port) => { await super.init(); } - }(addr, port); + }(addr, port, true); }); describe('Test CSRF protection', () => { diff --git a/test/_app.ts b/test/_app.ts index 643d66d..2992023 100644 --- a/test/_app.ts +++ b/test/_app.ts @@ -5,7 +5,7 @@ import MysqlConnectionManager from "../src/db/MysqlConnectionManager"; import config from "config"; -export default function useApp(appSupplier?: (addr: string, port: number) => Promise): void { +export default function useApp(appSupplier?: AppSupplier): void { let app: Application; beforeAll(async (done) => { @@ -14,7 +14,7 @@ export default function useApp(appSupplier?: (addr: string, port: number) => Pro await MysqlConnectionManager.endPool(); await setupMailServer(); - app = appSupplier ? await appSupplier('127.0.0.1', 8966) : new TestApp('127.0.0.1', 8966); + app = appSupplier ? await appSupplier('127.0.0.1', 8966) : new TestApp('127.0.0.1', 8966, true); await app.start(); done(); @@ -39,3 +39,5 @@ export default function useApp(appSupplier?: (addr: string, port: number) => Pro done(); }); } + +export type AppSupplier = (addr: string, port: number) => Promise;