From 2563af398da614fb77e9cccfacad31fac6e95f47 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Sun, 12 Oct 2025 15:10:02 -0400 Subject: [PATCH 1/2] fix(win): os agnostic tests --- .../__tests__/transports/github.test.mjs | 49 +++++++++++-------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/logger/__tests__/transports/github.test.mjs b/src/logger/__tests__/transports/github.test.mjs index 3ee156f8..f73d7c6b 100644 --- a/src/logger/__tests__/transports/github.test.mjs +++ b/src/logger/__tests__/transports/github.test.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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + 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', - ]); + deepStrictEqual( + callsArgs[0].trim(), + '::notice ::[00:00:00.000] INFO: Test message' + ); }); }); From f6bf32160ecbab5b6fdc78beeead5ceaae1c96be Mon Sep 17 00:00:00 2001 From: avivkeller Date: Sun, 12 Oct 2025 15:11:31 -0400 Subject: [PATCH 2/2] fixuP! --- src/logger/__tests__/transports/github.test.mjs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/logger/__tests__/transports/github.test.mjs b/src/logger/__tests__/transports/github.test.mjs index f73d7c6b..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,7 +24,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::debug::[00:00:00.000] \x1B[34mDEBUG\x1B[39m: Test message' ); @@ -48,7 +48,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message' ); @@ -73,7 +73,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::error ::[00:00:00.000] \x1B[35mERROR\x1B[39m: Test message' ); @@ -98,7 +98,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::error ::[00:00:00.000] \x1B[31mFATAL\x1B[39m: Test message' ); @@ -132,7 +132,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::notice file=test.md,line=1,endLine=1::[00:00:00.000] \x1B[32mINFO\x1B[39m: Test message' ); @@ -157,7 +157,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::notice ::[00:00:00.000] \x1B[32mINFO\x1B[39m (child1): Test message' ); @@ -184,7 +184,7 @@ describe('github', () => { ); strictEqual(process.stdout.write.mock.callCount(), 1); - deepStrictEqual( + strictEqual( callsArgs[0].trim(), '::notice ::[00:00:00.000] INFO: Test message' );