Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions system-test/logging-winston.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function logName(name: string) {
return `${UUID}_${name}`;
}

describe('LoggingWinston', () => {
describe('LoggingWinston', function() {
this.timeout(WRITE_CONSISTENCY_DELAY_MS);
const testTimestamp = new Date();

// type TestData
Expand Down Expand Up @@ -193,17 +194,13 @@ describe('LoggingWinston', () => {
const ERROR_REPORTING_POLL_TIMEOUT = WRITE_CONSISTENCY_DELAY_MS;
const errorsTransport = new ErrorsApiTransport();

beforeEach(async function() {
this.timeout(WRITE_CONSISTENCY_DELAY_MS);
});

after(async () => {
await errorsTransport.deleteAllEvents();
});

it('reports errors when logging errors with winston2', async () => {
const start = Date.now();
const service = 'logging-winston-system-test';
const service = `logging-winston-system-test-winston2-${UUID}`;
const LoggingWinston = inject('../src/index', {
winston: winston2,
'winston/package.json': {version: '2.2.0'}
Expand All @@ -224,14 +221,13 @@ describe('LoggingWinston', () => {
assert.strictEqual(errors.length, 1);
const errEvent = errors[0];

assert.strictEqual(
errEvent.serviceContext.service, 'logging-winston-system-test');
assert.strictEqual(errEvent.serviceContext.service, service);
assert(errEvent.message.startsWith(`an error Error: ${message}`));
});

it('reports errors when logging errors with winston3', async () => {
const start = Date.now();
const service = 'logging-winston-system-test-winston3';
const service = `logging-winston-system-test-winston3-${UUID}`;
const LoggingWinston = inject('../src/index', {
winston: winston3,
'winston/package.json': {version: '3.0.0'}
Expand All @@ -252,9 +248,7 @@ describe('LoggingWinston', () => {
assert.strictEqual(errors.length, 1);
const errEvent = errors[0];

assert.strictEqual(
errEvent.serviceContext.service,
'logging-winston-system-test-winston3');
assert.strictEqual(errEvent.serviceContext.service, service);

assert(errEvent.message.startsWith(message));
});
Expand Down