Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Hem committed Jan 3, 2018
1 parent de169bc commit bb2ac10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion test/index.ts
Expand Up @@ -3,11 +3,25 @@ import 'reflect-metadata';
import 'source-map-support/register';

import { ApplicationModule } from '../src/app/app.module';
import { uniqueEmail } from '../src/common/rules/unique-email.rule';
import { Startup } from '../src/lib/startup';

export async function getServer() {
if (!(global as any).__TEST_SERVER__) {
const { app, server } = await new Startup({ ApplicationModule }).main();
const { app, server } = await new Startup({
ApplicationModule,
indicative: {
defaultMessages: {
email: 'The {{field}} field is not valid.',
integer: 'The {{field}} field must be an integer.',
required: 'The {{field}} field is required.',
string: 'The {{field}} field must be a string.'
},
customRules: {
uniqueEmail
}
}
}).main();
await app.init();
(global as any).__TEST_SERVER__ = server;
}
Expand Down
2 changes: 1 addition & 1 deletion test/mocha.opts
Expand Up @@ -2,4 +2,4 @@
--require source-map-support/register
--recursive
--timeout 30000
src/**/*{.test.ts,.spec.ts,.e2e-spec.ts}
test/**/*{.test.ts,.spec.ts,.e2e-spec.ts}

0 comments on commit bb2ac10

Please sign in to comment.