From 78899cd893e31324576b5835b1fb9cdc180244ac Mon Sep 17 00:00:00 2001 From: "anchi.liu" Date: Mon, 13 May 2024 14:28:12 +0900 Subject: [PATCH] fix test --- test/jest/levelLog.spec.js | 4 ++-- test/jest/utils/levelLogUtils.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/jest/levelLog.spec.js b/test/jest/levelLog.spec.js index fa73bbd..2320078 100644 --- a/test/jest/levelLog.spec.js +++ b/test/jest/levelLog.spec.js @@ -152,8 +152,8 @@ describe('Date Format', () => { const fixedDate = new Date() logger.setDate(() => fixedDate.toLocaleTimeString()); logger.info("This is an info message"); - - const logFirstSpaceIndex = logger.lastCommand.indexOf(' '); + + const logFirstSpaceIndex = logger.lastCommand.indexOf(' ', 10); // xx:xx:xx AM/PM (....) const logDateStr = logger.lastCommand.slice(0, logFirstSpaceIndex); expect(logDateStr).toBe(fixedDate.toLocaleTimeString()); diff --git a/test/jest/utils/levelLogUtils.js b/test/jest/utils/levelLogUtils.js index 879b60c..cf4df56 100644 --- a/test/jest/utils/levelLogUtils.js +++ b/test/jest/utils/levelLogUtils.js @@ -32,6 +32,5 @@ const createLevelLogMessage = (level, message) => { module.exports = { getLevelLogMessage, - getLevelLogTimestamp, createLevelLogMessage } \ No newline at end of file