Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit 5eb7b3e

Browse files
committed
Fix winston test
1 parent 1cf1a24 commit 5eb7b3e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tests/integration/winston.test.ts

+14-7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ describe('WinstonTransport', () => {
1313
level: 'info',
1414
format: winston.format.json(),
1515
defaultMeta: { service: 'user-service' },
16-
transports: [
17-
// You can pass an option here, if you don't the transport is configured
18-
// using environment variables like `AXIOM_DATASET` and `AXIOM_TOKEN`
19-
new AxiomTransport(),
20-
],
16+
transports: [new AxiomTransport({ dataset: datasetName })],
2117
});
2218

2319
before(async () => {
@@ -38,9 +34,20 @@ describe('WinstonTransport', () => {
3834
});
3935

4036
// Wait for the log to be sent
41-
await new Promise((resolve) => setTimeout(resolve, 2000));
37+
await new Promise((resolve) => setTimeout(resolve, 1500));
4238

43-
const res = await client.datasets.aplQuery(`['${datasetName}']`);
39+
const startTime = new Date(new Date().getTime() - 1000 * 60 * 60 * 24).toISOString();
40+
const endTime = new Date(new Date().getTime() + 1000 * 60 * 60 * 24).toISOString();
41+
42+
// const res = await client.datasets.aplQuery(`['${datasetName}']`, {
43+
// startTime, endTime, streamingDuration: 'auto', noCache: false,
44+
// });
45+
46+
const res = await client.datasets.query(datasetName, {
47+
resolution: 'auto',
48+
startTime,
49+
endTime,
50+
});
4451
expect(res.matches).to.have.a.lengthOf(1);
4552
});
4653
});

0 commit comments

Comments
 (0)