Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c0f0f3c

Browse files
authoredMar 22, 2025··
fix(test): work on both CRLF and LF machines (#227)
1 parent 416e81f commit c0f0f3c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎src/linter/tests/reporters/console.test.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ describe('console', () => {
1313

1414
assert.strictEqual(process.stdout.write.mock.callCount(), 3);
1515

16-
const callsArgs = process.stdout.write.mock.calls.map(
17-
call => call.arguments[0]
16+
const callsArgs = process.stdout.write.mock.calls.map(call =>
17+
call.arguments[0].trim()
1818
);
1919

2020
assert.deepStrictEqual(callsArgs, [
21-
'\x1B[90mThis is a INFO issue at doc/api/test.md\x1B[39m\n',
22-
'\x1B[33mThis is a WARN issue at doc/api/test.md (1:1)\x1B[39m\n',
23-
'\x1B[31mThis is a ERROR issue at doc/api/test.md (1:1)\x1B[39m\n',
21+
'\x1B[90mThis is a INFO issue at doc/api/test.md\x1B[39m',
22+
'\x1B[33mThis is a WARN issue at doc/api/test.md (1:1)\x1B[39m',
23+
'\x1B[31mThis is a ERROR issue at doc/api/test.md (1:1)\x1B[39m',
2424
]);
2525
});
2626
});

‎src/linter/tests/reporters/gihub.test.mjs ‎src/linter/tests/reporters/github.test.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ describe('github', () => {
1313

1414
assert.strictEqual(process.stdout.write.mock.callCount(), 3);
1515

16-
const callsArgs = process.stdout.write.mock.calls.map(
17-
call => call.arguments[0]
16+
const callsArgs = process.stdout.write.mock.calls.map(call =>
17+
call.arguments[0].trim()
1818
);
1919

2020
assert.deepStrictEqual(callsArgs, [
21-
'::notice file=doc/api/test.md::This is a INFO issue\n',
22-
'::warning file=doc/api/test.md,line=1,endLine=1::This is a WARN issue\n',
23-
'::error file=doc/api/test.md,line=1,endLine=1::This is a ERROR issue\n',
21+
'::notice file=doc/api/test.md::This is a INFO issue',
22+
'::warning file=doc/api/test.md,line=1,endLine=1::This is a WARN issue',
23+
'::error file=doc/api/test.md,line=1,endLine=1::This is a ERROR issue',
2424
]);
2525
});
2626
});

0 commit comments

Comments
 (0)
Please sign in to comment.