summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs12
-rw-r--r--cli/tests/swc_syntax_error.ts3
-rw-r--r--cli/tests/swc_syntax_error.ts.out1
-rw-r--r--cli/tests/ts_decorators.ts14
-rw-r--r--cli/tests/ts_decorators.ts.out2
-rw-r--r--cli/tests/tsconfig.decorators.json5
6 files changed, 36 insertions, 1 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 9f73c91b3..457a345dd 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -1575,7 +1575,17 @@ itest!(ts_type_imports {
args: "run --reload ts_type_imports.ts",
output: "ts_type_imports.ts.out",
exit_code: 1,
- http_server: true,
+});
+
+itest!(ts_decorators {
+ args: "run --reload -c tsconfig.decorators.json ts_decorators.ts",
+ output: "ts_decorators.ts.out",
+});
+
+itest!(swc_syntax_error {
+ args: "run --reload swc_syntax_error.ts",
+ output: "swc_syntax_error.ts.out",
+ exit_code: 1,
});
itest!(types {
diff --git a/cli/tests/swc_syntax_error.ts b/cli/tests/swc_syntax_error.ts
new file mode 100644
index 000000000..70e0de97d
--- /dev/null
+++ b/cli/tests/swc_syntax_error.ts
@@ -0,0 +1,3 @@
+for await (const req of s) {
+ let something:
+}
diff --git a/cli/tests/swc_syntax_error.ts.out b/cli/tests/swc_syntax_error.ts.out
new file mode 100644
index 000000000..0896faf68
--- /dev/null
+++ b/cli/tests/swc_syntax_error.ts.out
@@ -0,0 +1 @@
+error: Unexpected token Some(RBrace) at [WILDCARD]syntax_error.ts:3:0
diff --git a/cli/tests/ts_decorators.ts b/cli/tests/ts_decorators.ts
new file mode 100644
index 000000000..67fd0604f
--- /dev/null
+++ b/cli/tests/ts_decorators.ts
@@ -0,0 +1,14 @@
+/* eslint-disable */
+
+function Decorate() {
+ return function (constructor: any): any {
+ return class extends constructor {
+ protected someField: string = "asdf";
+ };
+ };
+}
+
+@Decorate()
+class SomeClass {}
+
+console.log(new SomeClass());
diff --git a/cli/tests/ts_decorators.ts.out b/cli/tests/ts_decorators.ts.out
new file mode 100644
index 000000000..69d5937a9
--- /dev/null
+++ b/cli/tests/ts_decorators.ts.out
@@ -0,0 +1,2 @@
+Compile [WILDCARD]
+SomeClass { someField: "asdf" }
diff --git a/cli/tests/tsconfig.decorators.json b/cli/tests/tsconfig.decorators.json
new file mode 100644
index 000000000..504cd646e
--- /dev/null
+++ b/cli/tests/tsconfig.decorators.json
@@ -0,0 +1,5 @@
+{
+ "compilerOptions": {
+ "experimentalDecorators": true
+ }
+}