summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs5
-rw-r--r--cli/tests/no_check_decorators.ts21
-rw-r--r--cli/tests/no_check_decorators.ts.out3
-rw-r--r--cli/tests/subdir/more_decorators.ts18
-rw-r--r--cli/tests/ts_decorators_bundle.out2
-rw-r--r--cli/tests/ts_decorators_bundle.ts3
6 files changed, 52 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 64ef69ba1..2fd28a109 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -2570,6 +2570,11 @@ itest!(no_check {
http_server: true,
});
+itest!(no_check_decorators {
+ args: "run --quiet --reload --no-check no_check_decorators.ts",
+ output: "no_check_decorators.ts.out",
+});
+
itest!(lib_ref {
args: "run --quiet --unstable --reload lib_ref.ts",
output: "lib_ref.ts.out",
diff --git a/cli/tests/no_check_decorators.ts b/cli/tests/no_check_decorators.ts
new file mode 100644
index 000000000..d9a3747b9
--- /dev/null
+++ b/cli/tests/no_check_decorators.ts
@@ -0,0 +1,21 @@
+/* eslint-disable */
+function a() {
+ console.log("a(): evaluated");
+ return (
+ _target: any,
+ _propertyKey: string,
+ _descriptor: PropertyDescriptor,
+ ) => {
+ console.log("a(): called");
+ };
+}
+
+class B {
+ @a()
+ method() {
+ console.log("method");
+ }
+}
+
+const b = new B();
+b.method();
diff --git a/cli/tests/no_check_decorators.ts.out b/cli/tests/no_check_decorators.ts.out
new file mode 100644
index 000000000..015f7076e
--- /dev/null
+++ b/cli/tests/no_check_decorators.ts.out
@@ -0,0 +1,3 @@
+a(): evaluated
+a(): called
+method
diff --git a/cli/tests/subdir/more_decorators.ts b/cli/tests/subdir/more_decorators.ts
new file mode 100644
index 000000000..a67ae3fd6
--- /dev/null
+++ b/cli/tests/subdir/more_decorators.ts
@@ -0,0 +1,18 @@
+/* eslint-disable */
+function a() {
+ console.log("a(): evaluated");
+ return (
+ _target: any,
+ _propertyKey: string,
+ _descriptor: PropertyDescriptor,
+ ) => {
+ console.log("a(): called");
+ };
+}
+
+export class B {
+ @a()
+ method() {
+ console.log("method");
+ }
+}
diff --git a/cli/tests/ts_decorators_bundle.out b/cli/tests/ts_decorators_bundle.out
index 3a152aecc..a5b77b7bf 100644
--- a/cli/tests/ts_decorators_bundle.out
+++ b/cli/tests/ts_decorators_bundle.out
@@ -1,3 +1,5 @@
[WILDCARD]
+function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
+[WILDCARD]
new SomeClass().test();
[WILDCARD] \ No newline at end of file
diff --git a/cli/tests/ts_decorators_bundle.ts b/cli/tests/ts_decorators_bundle.ts
index a8e2e952b..d67ea4d5f 100644
--- a/cli/tests/ts_decorators_bundle.ts
+++ b/cli/tests/ts_decorators_bundle.ts
@@ -1,5 +1,7 @@
/* eslint-disable */
+import { B } from "./subdir/more_decorators.ts";
+
function Decorator() {
return function (
target: Record<string, any>,
@@ -20,3 +22,4 @@ class SomeClass {
}
new SomeClass().test();
+new B().method();