Skip to content

Commit

Permalink
test: fix Mocha patch with undefined timeout error (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSage committed Mar 8, 2021
1 parent f2894ca commit 25eb12b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions system-test/test-middleware-express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const LOG_NAME = `winston-system-test-${uuid.v4()}`;

describe(__filename, () => {
describe('global logger', () => {
it('should properly write log entries', async () => {
it('should properly write log entries', async function () {
this.timeout(TEST_TIMEOUT);
const logger = winston.createLogger();
await elb.makeMiddleware(logger, {
logName: LOG_NAME,
Expand All @@ -47,11 +48,12 @@ describe(__filename, () => {
const entries = (await log.getEntries({pageSize: 1}))[0];
assert.strictEqual(entries.length, 1);
assert.strictEqual(LOG_MESSAGE, entries[0].data.message);
}).timeout(TEST_TIMEOUT);
});
});

describe('request logging middleware', () => {
it('should write request correlated log entries', () => {
it('should write request correlated log entries', function () {
this.timeout(TEST_TIMEOUT);
// eslint-disable-next-line no-async-promise-executor
return new Promise(async resolve => {
const logger = winston.createLogger();
Expand Down Expand Up @@ -113,6 +115,6 @@ describe(__filename, () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
mw(fakeRequest as any, fakeResponse as any, next);
});
}).timeout(TEST_TIMEOUT);
});
});
});

0 comments on commit 25eb12b

Please sign in to comment.