Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(win): os agnostic tests
  • Loading branch information
avivkeller committed Oct 12, 2025
commit 2563af398da614fb77e9cccfacad31fac6e95f47
49 changes: 28 additions & 21 deletions src/logger/__tests__/transports/github.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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 => {
Expand All @@ -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 => {
Expand All @@ -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 => {
Expand Down Expand Up @@ -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 => {
Expand All @@ -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 => {
Expand All @@ -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'
);
});
});
Loading