Skip to content

Commit 764af0e

Browse files
Added tests and accepted baselines.
1 parent 6a34dc9 commit 764af0e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/harness/unittests/printer.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,29 @@ namespace ts {
110110
createSourceFile("source.ts", "", ScriptTarget.ES2015)
111111
));
112112

113+
114+
printsCorrectly("emptyGlobalAugmentation", {}, printer => printer.printNode(
115+
EmitHint.Unspecified,
116+
createModuleDeclaration(
117+
/*decorators*/ undefined,
118+
/*modifiers*/ [createToken(SyntaxKind.DeclareKeyword)],
119+
createIdentifier("global"),
120+
createModuleBlock(emptyArray),
121+
NodeFlags.GlobalAugmentation),
122+
createSourceFile("source.ts", "", ScriptTarget.ES2015)
123+
));
124+
125+
printsCorrectly("emptyGlobalAugmentationWithNoDeclareKeyword", {}, printer => printer.printNode(
126+
EmitHint.Unspecified,
127+
createModuleDeclaration(
128+
/*decorators*/ undefined,
129+
/*modifiers*/ undefined,
130+
createIdentifier("global"),
131+
createModuleBlock(emptyArray),
132+
NodeFlags.GlobalAugmentation),
133+
createSourceFile("source.ts", "", ScriptTarget.ES2015)
134+
));
135+
113136
// https://github.com/Microsoft/TypeScript/issues/15971
114137
printsCorrectly("classWithOptionalMethodAndProperty", {}, printer => printer.printNode(
115138
EmitHint.Unspecified,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module global { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module global { }

0 commit comments

Comments
 (0)