From ad9c36e0ecae1be0532b1e87db59ecc4f80c96bc Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 22 May 2019 10:00:09 -0700 Subject: [PATCH] Expose ts.Diagnostics to fourslash --- tests/cases/fourslash/fourslash.ts | 17 +++++++++++++++++ .../jsxExpressionFollowedByIdentifier.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index e6f2a08f002..29bfe9acade 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -42,6 +42,8 @@ // // TODO: figure out a better solution to the API exposure problem. +/// + declare module ts { export type MapKey = string | number; export interface Map { @@ -70,6 +72,21 @@ declare module ts { text: string; } + enum DiagnosticCategory { + Warning, + Error, + Suggestion, + Message + } + + interface DiagnosticMessage { + key: string; + category: DiagnosticCategory; + code: number; + message: string; + reportsUnnecessary?: {}; + } + function flatMap(array: ReadonlyArray, mapfn: (x: T, i: number) => U | ReadonlyArray | undefined): U[]; } diff --git a/tests/cases/fourslash/jsxExpressionFollowedByIdentifier.ts b/tests/cases/fourslash/jsxExpressionFollowedByIdentifier.ts index 501a325b989..16dcb7f6560 100644 --- a/tests/cases/fourslash/jsxExpressionFollowedByIdentifier.ts +++ b/tests/cases/fourslash/jsxExpressionFollowedByIdentifier.ts @@ -6,7 +6,7 @@ ////const b =
[|x|]} /> test.ranges().forEach(range => { - verify.errorExistsAtRange(range, 1005, "'}' expected."); + verify.errorExistsAtRange(range, ts.Diagnostics._0_expected.code, "'}' expected."); // This is just to ensure getting quick info doesn’t crash verify.not.quickInfoExists(); });