Skip to content

Commit b4bbc71

Browse files
committed
code review
1 parent d88e41f commit b4bbc71

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'node:test';
33

4-
import {
5-
errorIssue,
6-
infoIssue,
7-
warnIssue,
8-
} from '../../__tests__/fixtures/issues.mjs';
4+
import * as issues from '../../__tests__/fixtures/issues.mjs';
95
import github from '../github.mjs';
106

117
describe('github', () => {
128
it('should write to stdout with the correct fn based on the issue level', t => {
139
t.mock.method(process.stdout, 'write');
1410

15-
github(infoIssue);
16-
github(warnIssue);
17-
github(errorIssue);
11+
Object.values(issues).forEach(github);
1812

1913
assert.equal(process.stdout.write.mock.callCount(), 3);
2014

@@ -23,9 +17,9 @@ describe('github', () => {
2317
);
2418

2519
assert.deepEqual(callsArgs, [
20+
'::error file=doc/api/test.md,line=1,endLine=1::This is a ERROR issue',
2621
'::notice file=doc/api/test.md,line=1,endLine=1::This is a INFO issue',
2722
'::warning file=doc/api/test.md,line=1,endLine=1::This is a WARN issue',
28-
'::error file=doc/api/test.md,line=1,endLine=1::This is a ERROR issue',
2923
]);
3024
});
3125
});

0 commit comments

Comments
 (0)