diff --git a/src/logger/__tests__/transports/github.test.mjs b/src/logger/__tests__/transports/github.test.mjs index 3ee156f8..44674de8 100644 --- a/src/logger/__tests__/transports/github.test.mjs +++ b/src/logger/__tests__/transports/github.test.mjs @@ -1,4 +1,4 @@ -import { deepStrictEqual, strictEqual } from 'assert'; +import { strictEqual } from 'assert'; import { describe, it } from 'node:test'; import { LogLevel } from '../../constants.mjs'; @@ -24,9 +24,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::debug::[00:00:00.000] \x1B[34mDEBUG\x1B[39m: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::debug::[00:00:00.000] \x1B[34mDEBUG\x1B[39m: Test message' + ); }); it('should print info messages', t => { @@ -47,9 +48,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message' + ); }); it('should print error messages ', t => { @@ -71,9 +73,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::error ::[00:00:00.000] \x1B[35mERROR\x1B[39m: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::error ::[00:00:00.000] \x1B[35mERROR\x1B[39m: Test message' + ); }); it('should print fatal messages', t => { @@ -95,9 +98,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::error ::[00:00:00.000] \x1B[31mFATAL\x1B[39m: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::error ::[00:00:00.000] \x1B[31mFATAL\x1B[39m: Test message' + ); }); it('should print messages with file', t => { @@ -128,9 +132,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::notice file=test.md,line=1,endLine=1::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::notice file=test.md,line=1,endLine=1::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message' + ); }); it('should print child logger name', t => { @@ -152,9 +157,10 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m (child1): Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m (child1): Test message' + ); }); it('should print without colors if FORCE_COLOR = 0', t => { @@ -178,8 +184,9 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual(callsArgs, [ - '::notice ::[00:00:00.000] INFO: Test message\n', - ]); + strictEqual( + callsArgs[0].trim(), + '::notice ::[00:00:00.000] INFO: Test message' + ); }); });