diff --git a/test/index.ts b/test/index.ts index ef22286..a8ed5b1 100644 --- a/test/index.ts +++ b/test/index.ts @@ -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; } diff --git a/test/mocha.opts b/test/mocha.opts index c9b9dac..afc773b 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -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}