Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix Mocha patch with undefined timeout error #564

Merged
merged 1 commit into from
Mar 8, 2021
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
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);
});
});
});