summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-04-29 15:58:31 +0100
committerRyan Dahl <ry@tinyclouds.org>2019-04-29 07:58:31 -0700
commit1a0f53a807abad0e9ebfcf437f3dade6b01d7f84 (patch)
tree013eb8d15383a22a4e2c4c5502ba37035b397903 /tests
parent73be183864d0983821e683198d9a6ea9008f070a (diff)
Add support for custom tsconfig.json (#2089)
Use `--config`
Diffstat (limited to 'tests')
-rw-r--r--tests/config.test4
-rw-r--r--tests/config.ts5
-rw-r--r--tests/config.ts.out9
-rw-r--r--tests/config.tsconfig.json7
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/config.test b/tests/config.test
new file mode 100644
index 000000000..ee811ab8b
--- /dev/null
+++ b/tests/config.test
@@ -0,0 +1,4 @@
+args: --reload --config tests/config.tsconfig.json tests/config.ts
+check_stderr: true
+exit_code: 1
+output: tests/config.ts.out
diff --git a/tests/config.ts b/tests/config.ts
new file mode 100644
index 000000000..e08061e77
--- /dev/null
+++ b/tests/config.ts
@@ -0,0 +1,5 @@
+const map = new Map<string, { foo: string }>();
+
+if (map.get("bar").foo) {
+ console.log("here");
+}
diff --git a/tests/config.ts.out b/tests/config.ts.out
new file mode 100644
index 000000000..e3ceb52bc
--- /dev/null
+++ b/tests/config.ts.out
@@ -0,0 +1,9 @@
+Unsupported compiler options in "[WILDCARD]tests/config.tsconfig.json"
+ The following options were ignored:
+ module, target
+Compiling file://[WILDCARD]tests/config.ts
+[WILDCARD]tests/config.ts:3:5 - error TS2532: Object is possibly 'undefined'.
+
+3 if (map.get("bar").foo) {
+ ~~~~~~~~~~~~~~
+
diff --git a/tests/config.tsconfig.json b/tests/config.tsconfig.json
new file mode 100644
index 000000000..074d7ac0b
--- /dev/null
+++ b/tests/config.tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "compilerOptions": {
+ "module": "amd",
+ "strict": true,
+ "target": "es5"
+ }
+}