Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tigercosmos committed May 13, 2024
1 parent 7677511 commit 78899cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/jest/levelLog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion test/jest/utils/levelLogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ const createLevelLogMessage = (level, message) => {

module.exports = {
getLevelLogMessage,
getLevelLogTimestamp,
createLevelLogMessage
}

0 comments on commit 78899cd

Please sign in to comment.