diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index fbc6d8d6fea1d..3aaa217fbd09d 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -2361,7 +2361,7 @@ namespace ts { if (!host.fileExists(extendedConfigPath) && !endsWith(extendedConfigPath, Extension.Json)) { extendedConfigPath = `${extendedConfigPath}.json`; if (!host.fileExists(extendedConfigPath)) { - errors.push(createDiagnostic(Diagnostics.File_0_does_not_exist, extendedConfig)); + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); return undefined; } } @@ -2372,7 +2372,7 @@ namespace ts { if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(Diagnostics.File_0_does_not_exist, extendedConfig)); + errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig)); return undefined; } diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index 25e975c0fb208..6c1fc9522954a 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -197,13 +197,13 @@ namespace ts { const caseSensitiveBasePath = "/dev/"; const caseSensitiveHost = new fakes.ParseConfigHost(createFileSystem(/*ignoreCase*/ false, caseSensitiveBasePath, "/")); - function verifyDiagnostics(actual: Diagnostic[], expected: {code: number, category: DiagnosticCategory, messageText: string}[]) { + function verifyDiagnostics(actual: Diagnostic[], expected: { code: number; messageText: string; }[]) { assert.isTrue(expected.length === actual.length, `Expected error: ${JSON.stringify(expected)}. Actual error: ${JSON.stringify(actual)}.`); for (let i = 0; i < actual.length; i++) { const actualError = actual[i]; const expectedError = expected[i]; assert.equal(actualError.code, expectedError.code, "Error code mismatch"); - assert.equal(actualError.category, expectedError.category, "Category mismatch"); + assert.equal(actualError.category, DiagnosticCategory.Error, "Category mismatch"); // Should always be error assert.equal(flattenDiagnosticMessageText(actualError.messageText, "\n"), expectedError.messageText); } } @@ -246,7 +246,7 @@ namespace ts { }); } - function testFailure(name: string, entry: string, expectedDiagnostics: { code: number, category: DiagnosticCategory, messageText: string }[]) { + function testFailure(name: string, entry: string, expectedDiagnostics: { code: number; messageText: string; }[]) { it(name, () => { const parsed = getParseCommandLine(entry); verifyDiagnostics(parsed.errors, expectedDiagnostics); @@ -280,26 +280,22 @@ namespace ts { testFailure("can report errors on circular imports", "circular.json", [ { code: 18000, - category: DiagnosticCategory.Error, messageText: `Circularity detected while resolving configuration: ${[combinePaths(basePath, "circular.json"), combinePaths(basePath, "circular2.json"), combinePaths(basePath, "circular.json")].join(" -> ")}` } ]); testFailure("can report missing configurations", "missing.json", [{ - code: 6096, - category: DiagnosticCategory.Message, - messageText: `File './missing2' does not exist.` + code: 6053, + messageText: `File './missing2' not found.` }]); testFailure("can report errors in extended configs", "failure.json", [{ code: 6114, - category: DiagnosticCategory.Error, messageText: `Unknown option 'excludes'. Did you mean 'exclude'?` }]); testFailure("can error when 'extends' is not a string", "extends.json", [{ code: 5024, - category: DiagnosticCategory.Error, messageText: `Compiler option 'extends' requires a value of type string.` }]);