diff --git a/integration/src/winston.spec.ts b/integration/src/winston.spec.ts index 26cff1a5..3363c8ec 100644 --- a/integration/src/winston.spec.ts +++ b/integration/src/winston.spec.ts @@ -32,23 +32,27 @@ describe('WinstonTransport', () => { logger.log({ level: 'info', message: 'Hello from winston', + callback: (err: Error) => { + console.error("winston failed to send logs", err) + } }); + logger.end() + + logger.on('finish', () => { + console.log('All logs have been sent'); + }) + // Wait for the log to be sent await new Promise((resolve) => setTimeout(resolve, 1500)); const startTime = new Date(new Date().getTime() - 1000 * 60 * 60 * 24).toISOString(); const endTime = new Date(new Date().getTime() + 1000 * 60 * 60 * 24).toISOString(); - // const res = await axiom.datasets.query(`['${datasetName}']`, { - // startTime, endTime, streamingDuration: 'auto', noCache: false, - // }); - - const res = await axiom.queryLegacy(datasetName, { - resolution: 'auto', - startTime, - endTime, + const res = await axiom.query(`['${datasetName}']`, { + startTime, endTime, streamingDuration: 'auto', noCache: false, }); + expect(res.matches).toHaveLength(1); }); });