Skip to content

Commit 7b1388b

Browse files
author
Andy Hanson
committed
Ensure verify.noErrors tests json files
1 parent 96f9e07 commit 7b1388b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/harness/fourslash.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ namespace FourSlash {
593593
public verifyNoErrors() {
594594
ts.forEachKey(this.inputFiles, fileName => {
595595
if (!ts.isAnySupportedFileExtension(fileName)
596-
|| !this.getProgram().getCompilerOptions().allowJs && !ts.extensionIsTS(ts.extensionFromPath(fileName))) return;
596+
|| Harness.getConfigNameFromFileName(fileName)
597+
|| !this.getProgram().getCompilerOptions().allowJs && !ts.resolutionExtensionIsTSOrJson(ts.extensionFromPath(fileName))) return;
597598
const errors = this.getDiagnostics(fileName).filter(e => e.category !== ts.DiagnosticCategory.Suggestion);
598599
if (errors.length) {
599600
this.printErrorLog(/*expectErrors*/ false, errors);

tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// @strict: true
66

77
// @Filename: /node_modules/foo/bar.json
8-
////export const x = 0;
8+
////{ "a": 0 }
99

1010
// @Filename: /a.ts
1111
////import abs = require([|"foo/bar.json"|]);

0 commit comments

Comments
 (0)