Ensure verify.noErrors tests json files

This commit is contained in:
Andy Hanson
2018-09-26 16:05:12 -07:00
parent 96f9e076f8
commit 7b1388b071
2 changed files with 3 additions and 2 deletions

View File

@@ -593,7 +593,8 @@ namespace FourSlash {
public verifyNoErrors() {
ts.forEachKey(this.inputFiles, fileName => {
if (!ts.isAnySupportedFileExtension(fileName)
|| !this.getProgram().getCompilerOptions().allowJs && !ts.extensionIsTS(ts.extensionFromPath(fileName))) return;
|| Harness.getConfigNameFromFileName(fileName)
|| !this.getProgram().getCompilerOptions().allowJs && !ts.resolutionExtensionIsTSOrJson(ts.extensionFromPath(fileName))) return;
const errors = this.getDiagnostics(fileName).filter(e => e.category !== ts.DiagnosticCategory.Suggestion);
if (errors.length) {
this.printErrorLog(/*expectErrors*/ false, errors);

View File

@@ -5,7 +5,7 @@
// @strict: true
// @Filename: /node_modules/foo/bar.json
////export const x = 0;
////{ "a": 0 }
// @Filename: /a.ts
////import abs = require([|"foo/bar.json"|]);