Make test-node report errors
This commit is contained in:
parent
8fe1be8678
commit
fc3004a183
2 changed files with 7 additions and 4 deletions
|
@ -6,9 +6,7 @@
|
|||
const ByteBuffer = require('../components/bytebuffer/dist/ByteBufferAB.js');
|
||||
const { setEnvironment, Environment } = require('../ts/environment');
|
||||
|
||||
before(() => {
|
||||
setEnvironment(Environment.Test);
|
||||
});
|
||||
setEnvironment(Environment.Test);
|
||||
|
||||
// To replicate logic we have on the client side
|
||||
global.window = {
|
||||
|
|
|
@ -17,6 +17,8 @@ import { read as readLastLines } from 'read-last-lines';
|
|||
import rimraf from 'rimraf';
|
||||
import { createStream } from 'rotating-file-stream';
|
||||
|
||||
import { Environment, getEnvironment } from '../environment';
|
||||
|
||||
import {
|
||||
LogEntryType,
|
||||
LogLevel,
|
||||
|
@ -37,7 +39,10 @@ declare global {
|
|||
|
||||
let globalLogger: undefined | pinoms.Logger;
|
||||
|
||||
const isRunningFromConsole = Boolean(process.stdout.isTTY);
|
||||
const isRunningFromConsole =
|
||||
Boolean(process.stdout.isTTY) ||
|
||||
getEnvironment() === Environment.Test ||
|
||||
getEnvironment() === Environment.TestLib;
|
||||
|
||||
export async function initialize(): Promise<pinoms.Logger> {
|
||||
if (globalLogger) {
|
||||
|
|
Loading…
Reference in a new issue