diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/088_use_define_for_class_fields.ts | 4 | ||||
-rw-r--r-- | cli/tests/088_use_define_for_class_fields.ts.out | 4 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/088_use_define_for_class_fields.ts b/cli/tests/088_use_define_for_class_fields.ts new file mode 100644 index 000000000..9be984abf --- /dev/null +++ b/cli/tests/088_use_define_for_class_fields.ts @@ -0,0 +1,4 @@ +class A { + b = this.a; + constructor(public a: unknown) {} +} diff --git a/cli/tests/088_use_define_for_class_fields.ts.out b/cli/tests/088_use_define_for_class_fields.ts.out new file mode 100644 index 000000000..08f94a967 --- /dev/null +++ b/cli/tests/088_use_define_for_class_fields.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]error: TS2729 [ERROR]: Property 'a' is used before its initialization. + b = this.a; + ^ +[WILDCARD] diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 23d119d44..cddeb40f6 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2841,6 +2841,12 @@ console.log("finish"); output: "087_no_check_imports_not_used_as_values.ts.out", }); + itest!(_088_use_define_for_class_fields { + args: "run 088_use_define_for_class_fields.ts", + output: "088_use_define_for_class_fields.ts.out", + exit_code: 1, + }); + itest!(js_import_detect { args: "run --quiet --reload js_import_detect.ts", output: "js_import_detect.ts.out", |