Skip to content

Commit 64358a2

Browse files
Fix test to properly check declaration output and remove invalid .d.ts file
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent 5971e08 commit 64358a2

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

tests/baselines/reference/enumNamespaceConstantsDeclaration.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,42 @@ var StringEnum;
5656
(function (StringEnum) {
5757
StringEnum.selected = StringEnum.Option1;
5858
})(StringEnum || (StringEnum = {}));
59+
60+
61+
//// [enumNamespaceConstantsDeclaration.d.ts]
62+
declare enum Foo {
63+
bar = 0
64+
}
65+
declare namespace Foo {
66+
const baz = Foo.bar;
67+
}
68+
declare enum MyEnum {
69+
First = 1,
70+
Second = 2
71+
}
72+
declare namespace MyEnum {
73+
const value1 = MyEnum.First;
74+
const value2 = MyEnum.Second;
75+
}
76+
declare enum StringEnum {
77+
Option1 = "option1",
78+
Option2 = "option2"
79+
}
80+
declare namespace StringEnum {
81+
const selected: any;
82+
}
83+
84+
85+
!!!! File enumNamespaceConstantsDeclaration.d.ts differs from original emit in noCheck emit
86+
//// [enumNamespaceConstantsDeclaration.d.ts]
87+
===================================================================
88+
--- Expected The full check baseline
89+
+++ Actual with noCheck set
90+
@@ -16,6 +16,6 @@
91+
Option1 = "option1",
92+
Option2 = "option2"
93+
}
94+
declare namespace StringEnum {
95+
- const selected: any;
96+
+ const selected = StringEnum.Option1;
97+
}

tests/cases/compiler/enumNamespaceConstantsDeclaration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @declaration: true
2+
13
// Test for constant declarations inside namespace merged with enum
24
enum Foo {
35
bar

0 commit comments

Comments
 (0)