Skip to content

Commit

Permalink
test: Decode the URLs in the report (#5098)
Browse files Browse the repository at this point in the history
Co-authored-by: street-side-software-automation[bot] <74785433+street-side-software-automation[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 6cf2a4b commit b146a48
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 89 deletions.
8 changes: 4 additions & 4 deletions integration-tests/snapshots/eslint/eslint/report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ issues:
- "docs/src/_plugins/md-syntax-highlighter.js:4:29 Yuxi U Copyright (c) 2019-present, Yuxi (Evan) You"
- "docs/src/about/index.md:6:87 Zakas U created by Nicholas C. Zakas in June 2013. Code"
- "docs/src/assets/js/components-index.js:17:14 toggleindex U function toggleindex(e) {"
- "docs/src/assets/js/css-vars-ponyfill%402.js:2:13 ponyfill U * css-vars-ponyfill"
- "docs/src/assets/js/css-vars-ponyfill%402.js:5:23 Hildenbiddle U (c) 2018-2019 John Hildenbiddle <http://hildenbiddle"
- "docs/src/assets/js/css-vars-ponyfill%402.js:8:10158 CSSVARSPONYFILL U e.comment.indexOf(\"__CSSVARSPONYFILL\")?\"/*\"+e.comment+\"*"
- "docs/src/assets/js/css-vars-ponyfill%402.js:8:14683 cssvars U e.hasAttribute(\"data-cssvars\"),n=function(e){return"
- "docs/src/assets/js/css-vars-ponyfill@2.js:2:13 ponyfill U * css-vars-ponyfill"
- "docs/src/assets/js/css-vars-ponyfill@2.js:5:23 Hildenbiddle U (c) 2018-2019 John Hildenbiddle <http://hildenbiddle"
- "docs/src/assets/js/css-vars-ponyfill@2.js:8:10158 CSSVARSPONYFILL U e.comment.indexOf(\"__CSSVARSPONYFILL\")?\"/*\"+e.comment+\"*"
- "docs/src/assets/js/css-vars-ponyfill@2.js:8:14683 cssvars U e.hasAttribute(\"data-cssvars\"),n=function(e){return"
- "docs/src/assets/js/focus-visible.js:26:5 datetime U datetime: true,"
- "docs/src/assets/js/focus-visible.js:31:46 iframes U legacy browsers and iframes which sometimes focus"
- "docs/src/assets/js/main.js:105:51 togglenav U addEventListener(\"click\", togglenav, false);"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2772,9 +2772,9 @@ issues:
- "Stored_Procedure/dbo.sp_FailedLogins.sql:28:1 Logdate U Logdate Datetime,"
- "Stored_Procedure/dbo.sp_FailedLogins.sql:29:1 Processinfo U Processinfo Varchar(30),"
- "Stored_Procedure/dbo.sp_FailedLogins.sql:39:1 Latestdate U Latestdate.LastError"
- "Stored_Procedure/dbo.sp_foreign_key%24batch_drop_and_recreate.sql:25:26 drsql U 17 Louis Davidson - drsql.org"
- "Stored_Procedure/dbo.sp_foreign_key%24batch_drop_and_recreate.sql:129:117 resore U where the objects to resore are stored',1;"
- "Stored_Procedure/dbo.sp_foreign_key%24batch_drop_and_recreate.sql:143:52 codelocation U @trustedFlag BIT, @codelocation VARCHAR(200), @statement"
- "Stored_Procedure/dbo.sp_foreign_key$batch_drop_and_recreate.sql:25:26 drsql U 17 Louis Davidson - drsql.org"
- "Stored_Procedure/dbo.sp_foreign_key$batch_drop_and_recreate.sql:129:117 resore U where the objects to resore are stored',1;"
- "Stored_Procedure/dbo.sp_foreign_key$batch_drop_and_recreate.sql:143:52 codelocation U @trustedFlag BIT, @codelocation VARCHAR(200), @statement"
- "Stored_Procedure/dbo.sp_generate_merge.sql:26:3 ommit U @ommit_images bit = 0, -- Use"
- "Stored_Procedure/dbo.sp_generate_merge.sql:78:2 Divya U Divya Kalra -- For beta testing"
- "Stored_Procedure/dbo.sp_generate_merge.sql:78:8 Kalra U Divya Kalra -- For beta testing"
Expand Down
148 changes: 74 additions & 74 deletions integration-tests/snapshots/sveltejs/svelte/report.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions integration-tests/src/reporter/reportGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export function generateReport(data: ReportData): Report {
function relative(uri: string) {
if (uri.startsWith(rootUri)) {
const r = uri.slice(rootUri.length);
return decodeURI(r.startsWith('/') ? r.slice(1) : r);
return decodeURIComponent(r.startsWith('/') ? r.slice(1) : r);
}
return decodeURI(uri);
return decodeURIComponent(uri);
}
issues.forEach((issue) => {
const uri = issue.uri || '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ describe('docValidator', () => {
);

test.each`
filename | maxDuplicateProblems | expectedIssues | expectedRawIssues
${tFix('issues/issue-4811/#local/README.md')} | ${undefined} | ${[]} | ${undefined}
filename | maxDuplicateProblems | expectedIssues | expectedRawIssues
${tFix('issues/issue-4811/#local/README.md')} | ${undefined} | ${[]} | ${undefined}
${tFix('issues/issue-4811/#local/version@2.md')} | ${undefined} | ${['marrkdown']} | ${undefined /* cspell:disable-line */}
`(
'checkDocument $filename $maxDuplicateProblems',
async ({ filename, maxDuplicateProblems, expectedIssues, expectedRawIssues }) => {
Expand Down
15 changes: 12 additions & 3 deletions packages/cspell/src/app/__snapshots__/app.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,20 @@ exports[`Validate cli > app 'issue-2998 --language-id' Expect Error: undefined 3
1/1 ./fix-words.txt"
`;
exports[`Validate cli > app 'issue-4811' Expect Error: undefined 1`] = `[]`;
exports[`Validate cli > app 'issue-4811 **/README.md' Expect Error: undefined 1`] = `[]`;
exports[`Validate cli > app 'issue-4811' Expect Error: undefined 2`] = `"error CSpell: Files checked: 8, Issues found: 0 in 0 files"`;
exports[`Validate cli > app 'issue-4811 **/README.md' Expect Error: undefined 2`] = `"error CSpell: Files checked: 2, Issues found: 0 in 0 files"`;
exports[`Validate cli > app 'issue-4811' Expect Error: undefined 3`] = `""`;
exports[`Validate cli > app 'issue-4811 **/README.md' Expect Error: undefined 3`] = `""`;
exports[`Validate cli > app 'issue-4811' Expect Error: [Function CheckFailed] 1`] = `[]`;
exports[`Validate cli > app 'issue-4811' Expect Error: [Function CheckFailed] 2`] = `
"log ./#local/version@2.md:3:9 - Unknown word (marrkdown)
error CSpell: Files checked: 9, Issues found: 1 in 1 files"
`;
exports[`Validate cli > app 'issue-4811' Expect Error: [Function CheckFailed] 3`] = `""`;
exports[`Validate cli > app 'issue-4811/#local' Expect Error: undefined 1`] = `[]`;
Expand Down
3 changes: 2 additions & 1 deletion packages/cspell/src/app/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ describe('Validate cli', () => {
${'typos --show-suggestions'} | ${['-r', pathFix('features/typos'), '--no-progress', '--show-suggestions', '**']} | ${app.CheckFailed} | ${true} | ${true} | ${false}
${'inline suggest'} | ${['-r', pathFix('features/inline-suggest'), '--no-progress', '--show-suggestions', '.']} | ${app.CheckFailed} | ${true} | ${true} | ${false}
${'reporter'} | ${['-r', pathFix('features/reporter'), '-c', pathFix('features/reporter/cspell.config.yaml')]} | ${undefined} | ${false} | ${true} | ${false}
${'issue-4811'} | ${['-r', pIssues('issue-4811'), '--no-progress', '.']} | ${undefined} | ${true} | ${false} | ${false}
${'issue-4811 **/README.md'} | ${['-r', pIssues('issue-4811'), '--no-progress', '**/README.md']} | ${undefined} | ${true} | ${false} | ${false}
${'issue-4811'} | ${['-r', pIssues('issue-4811'), '--no-progress', '.']} | ${app.CheckFailed} | ${true} | ${true} | ${false}
`('app $msg Expect Error: $errorCheck', async ({ testArgs, errorCheck, eError, eLog, eInfo }: TestCase) => {
chalk.level = 1;
const commander = getCommander();
Expand Down
3 changes: 3 additions & 0 deletions test-fixtures/issues/issue-4811/#local/version@2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Version 2

This is marrkdown v2.

0 comments on commit b146a48

Please sign in to comment.