Skip to content

Commit

Permalink
set logger to console for test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
giall committed Dec 2, 2019
1 parent fe3697e commit 54ed451
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class Logger {

constructor() {
const { level } = properties.logging;
this.log = (level !== 'test') ? pino({level}) : console;
this.log = (process.env.NODE_ENV !== 'test') ? pino({level}) : console;
}

debug(log: any, ...args: any[]) {
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import * as request from 'supertest';
import * as http from 'http';

import { properties } from '../../src/properties/properties';
properties.logging.level = 'test';
properties.options.emailVerificationRequired = true;

import { v4 as uuid } from 'uuid';
import { chance } from '../utils/chance';
import { accessToken, emailVerification, magicLogin, passwordReset, refreshToken } from '../../src/utils/token.utils';
Expand All @@ -15,6 +12,8 @@ import { User } from '../../src/models/user';
import { UserRepository } from '../../src/repositories/user.repository';
import { DummyTransporter } from '../mocks/dummy.transporter';

properties.options.emailVerificationRequired = true;

let server: http.Server;
let mongod: MongoMemoryServer;
let database: Database;
Expand Down

0 comments on commit 54ed451

Please sign in to comment.