aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/transpiler/decorators.test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/transpiler/decorators.test.ts b/test/transpiler/decorators.test.ts
index 100ecc3bc..885391800 100644
--- a/test/transpiler/decorators.test.ts
+++ b/test/transpiler/decorators.test.ts
@@ -998,3 +998,23 @@ test("export default class Named works", () => {
test("export default class works (anonymous name)", () => {
expect(new DecoratedAnonClass()["methoddecorated"]).toBe(true);
});
+
+test("decorator and declare", () => {
+ let counter = 0;
+ function d1(t) {
+ t();
+ }
+ class A {
+ @d1(() => {
+ counter++;
+ })
+ declare a: number;
+
+ m() {
+ counter++;
+ }
+ }
+
+ new A();
+ expect(counter).toBe(1);
+});