TestApp: don't ignore commands by default
This commit is contained in:
parent
f91bd6851f
commit
8867f06828
@ -50,8 +50,8 @@ export default class TestApp extends Application {
|
|||||||
private readonly addr: string;
|
private readonly addr: string;
|
||||||
private readonly port: number;
|
private readonly port: number;
|
||||||
|
|
||||||
public constructor(addr: string, port: number) {
|
public constructor(addr: string, port: number, ignoreCommandLine: boolean = false) {
|
||||||
super(packageJson.version, true);
|
super(packageJson.version, ignoreCommandLine);
|
||||||
this.addr = addr;
|
this.addr = addr;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ useApp(async (addr, port) => {
|
|||||||
|
|
||||||
await super.init();
|
await super.init();
|
||||||
}
|
}
|
||||||
}(addr, port);
|
}(addr, port, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
let agent: supertest.SuperTest<supertest.Test>;
|
let agent: supertest.SuperTest<supertest.Test>;
|
||||||
|
@ -37,7 +37,7 @@ useApp(async (addr, port) => {
|
|||||||
protected getMigrations(): MigrationType<Migration>[] {
|
protected getMigrations(): MigrationType<Migration>[] {
|
||||||
return super.getMigrations().filter(m => m !== AddNameToUsersMigration);
|
return super.getMigrations().filter(m => m !== AddNameToUsersMigration);
|
||||||
}
|
}
|
||||||
}(addr, port);
|
}(addr, port, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
let agent: supertest.SuperTest<supertest.Test>;
|
let agent: supertest.SuperTest<supertest.Test>;
|
||||||
|
@ -24,7 +24,7 @@ useApp(async (addr, port) => {
|
|||||||
|
|
||||||
await super.init();
|
await super.init();
|
||||||
}
|
}
|
||||||
}(addr, port);
|
}(addr, port, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Test CSRF protection', () => {
|
describe('Test CSRF protection', () => {
|
||||||
|
@ -5,7 +5,7 @@ import MysqlConnectionManager from "../src/db/MysqlConnectionManager";
|
|||||||
import config from "config";
|
import config from "config";
|
||||||
|
|
||||||
|
|
||||||
export default function useApp(appSupplier?: (addr: string, port: number) => Promise<TestApp>): void {
|
export default function useApp(appSupplier?: AppSupplier): void {
|
||||||
let app: Application;
|
let app: Application;
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
@ -14,7 +14,7 @@ export default function useApp(appSupplier?: (addr: string, port: number) => Pro
|
|||||||
await MysqlConnectionManager.endPool();
|
await MysqlConnectionManager.endPool();
|
||||||
|
|
||||||
await setupMailServer();
|
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();
|
await app.start();
|
||||||
done();
|
done();
|
||||||
@ -39,3 +39,5 @@ export default function useApp(appSupplier?: (addr: string, port: number) => Pro
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AppSupplier = (addr: string, port: number) => Promise<TestApp>;
|
||||||
|
Loading…
Reference in New Issue
Block a user