mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 10:43:51 -05:00
Update fourslash for getEmitOutput
This commit is contained in:
@@ -44,6 +44,14 @@ enum TypingFidelity {
|
||||
High = FourSlash.TypingFidelity.High
|
||||
}
|
||||
|
||||
// We have to duplicate EmitOutputResult from Services.ts to expose the enum to getEmitOutput testcases in fourslah
|
||||
enum EmitOutputResult {
|
||||
Succeeded,
|
||||
FailedBecauseOfSyntaxErrors,
|
||||
FailedBecauseOfCompilerOptionsErrors,
|
||||
FailedToGenerateDeclarationsBecauseOfSemanticErrors
|
||||
}
|
||||
|
||||
module FourSlashInterface {
|
||||
declare var FourSlash;
|
||||
|
||||
@@ -255,6 +263,10 @@ module FourSlashInterface {
|
||||
FourSlash.currentTestState.verifyEval(expr, value);
|
||||
}
|
||||
|
||||
public emitOutput(expectedState: EmitOutputResult, expectedFilename?: string) {
|
||||
FourSlash.currentTestState.verifyEmitOutput(expectedState, expectedFilename);
|
||||
}
|
||||
|
||||
public currentLineContentIs(text: string) {
|
||||
FourSlash.currentTestState.verifyCurrentLineContent(text);
|
||||
}
|
||||
@@ -431,6 +443,23 @@ module FourSlashInterface {
|
||||
public disableFormatting() {
|
||||
FourSlash.currentTestState.enableFormatting = false;
|
||||
}
|
||||
|
||||
public enableDeclaration() {
|
||||
FourSlash.currentTestState.enableDeclaration = true;
|
||||
}
|
||||
|
||||
public disableDeclaration() {
|
||||
FourSlash.currentTestState.enableDeclaration = false;
|
||||
}
|
||||
|
||||
public enableSingleOutputFile(outputFilename: string) {
|
||||
FourSlash.currentTestState.enableSingleOutputFile = true;
|
||||
FourSlash.currentTestState.singleOutputFilename = outputFilename;
|
||||
}
|
||||
|
||||
public disableSingleOutputFile() {
|
||||
FourSlash.currentTestState.enableSingleOutputFile = false;
|
||||
}
|
||||
}
|
||||
|
||||
export class debug {
|
||||
|
||||
Reference in New Issue
Block a user