test(comments): 改善嚴重問題留言斷言可讀性
This commit is contained in:
@@ -163,6 +163,7 @@ describe('postNewCriticalComments', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('handles multiple criticals, posting inline where possible and degrading the rest', async () => {
|
it('handles multiple criticals, posting inline where possible and degrading the rest', async () => {
|
||||||
|
const criticalCommentPattern = /嚴重問題/;
|
||||||
const inlineCalls = [];
|
const inlineCalls = [];
|
||||||
const issueCalls = [];
|
const issueCalls = [];
|
||||||
const findings = [
|
const findings = [
|
||||||
@@ -181,6 +182,6 @@ describe('postNewCriticalComments', () => {
|
|||||||
assert.equal(inlineCalls[0].path, 'app/a.js');
|
assert.equal(inlineCalls[0].path, 'app/a.js');
|
||||||
assert.equal(inlineCalls[0].line, 10);
|
assert.equal(inlineCalls[0].line, 10);
|
||||||
assert.equal(issueCalls.length, 2);
|
assert.equal(issueCalls.length, 2);
|
||||||
assert.ok(issueCalls.every(b => /嚴重問題/.test(b)));
|
assert.ok(issueCalls.every(b => criticalCommentPattern.test(b)));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user