summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/test/sanitizer_with_error/__test__.json5
-rw-r--r--tests/specs/test/sanitizer_with_error/main.js6
-rw-r--r--tests/specs/test/sanitizer_with_error/main.out18
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/specs/test/sanitizer_with_error/__test__.json b/tests/specs/test/sanitizer_with_error/__test__.json
new file mode 100644
index 000000000..d92c3a31f
--- /dev/null
+++ b/tests/specs/test/sanitizer_with_error/__test__.json
@@ -0,0 +1,5 @@
+{
+ "args": "test --quiet --reload main.js",
+ "output": "main.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/test/sanitizer_with_error/main.js b/tests/specs/test/sanitizer_with_error/main.js
new file mode 100644
index 000000000..38d0ea81e
--- /dev/null
+++ b/tests/specs/test/sanitizer_with_error/main.js
@@ -0,0 +1,6 @@
+Deno.test(function throws() {
+ // Leak
+ setTimeout(() => {}, 60_000);
+ // But the exception should mask the leak
+ throw new Error("Throws");
+});
diff --git a/tests/specs/test/sanitizer_with_error/main.out b/tests/specs/test/sanitizer_with_error/main.out
new file mode 100644
index 000000000..2be6bf946
--- /dev/null
+++ b/tests/specs/test/sanitizer_with_error/main.out
@@ -0,0 +1,18 @@
+running 1 test from ./main.js
+throws ... FAILED ([WILDCARD])
+
+ ERRORS
+
+throws => ./main.js:1:6
+error: Error: Throws
+ throw new Error("Throws");
+ ^
+ at throws ([WILDCARD]/main.js:5:9)
+
+ FAILURES
+
+throws => ./main.js:1:6
+
+FAILED | 0 passed | 1 failed ([WILDCARD])
+
+error: Test failed