summaryrefslogtreecommitdiff
path: root/tests/specs/test/exit_sanitizer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/test/exit_sanitizer')
-rw-r--r--tests/specs/test/exit_sanitizer/__test__.jsonc5
-rw-r--r--tests/specs/test/exit_sanitizer/exit_sanitizer.out38
-rw-r--r--tests/specs/test/exit_sanitizer/exit_sanitizer.ts11
3 files changed, 54 insertions, 0 deletions
diff --git a/tests/specs/test/exit_sanitizer/__test__.jsonc b/tests/specs/test/exit_sanitizer/__test__.jsonc
new file mode 100644
index 000000000..79d075d67
--- /dev/null
+++ b/tests/specs/test/exit_sanitizer/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "test exit_sanitizer.ts",
+ "output": "exit_sanitizer.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/test/exit_sanitizer/exit_sanitizer.out b/tests/specs/test/exit_sanitizer/exit_sanitizer.out
new file mode 100644
index 000000000..305d51cc8
--- /dev/null
+++ b/tests/specs/test/exit_sanitizer/exit_sanitizer.out
@@ -0,0 +1,38 @@
+Check [WILDCARD]/exit_sanitizer.ts
+running 3 tests from [WILDCARD]/exit_sanitizer.ts
+exit(0) ... FAILED ([WILDCARD])
+exit(1) ... FAILED ([WILDCARD])
+exit(2) ... FAILED ([WILDCARD])
+
+ ERRORS
+
+exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+error: Error: Test case attempted to exit with exit code: 0
+ Deno.exit(0);
+ ^
+ at [WILDCARD]
+ at [WILDCARD]/exit_sanitizer.ts:2:8
+
+exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+error: Error: Test case attempted to exit with exit code: 1
+ Deno.exit(1);
+ ^
+ at [WILDCARD]
+ at [WILDCARD]/exit_sanitizer.ts:6:8
+
+exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+error: Error: Test case attempted to exit with exit code: 2
+ Deno.exit(2);
+ ^
+ at [WILDCARD]
+ at [WILDCARD]/exit_sanitizer.ts:10:8
+
+ FAILURES
+
+exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
+
+FAILED | 0 passed | 3 failed ([WILDCARD])
+
+error: Test failed
diff --git a/tests/specs/test/exit_sanitizer/exit_sanitizer.ts b/tests/specs/test/exit_sanitizer/exit_sanitizer.ts
new file mode 100644
index 000000000..186406a9d
--- /dev/null
+++ b/tests/specs/test/exit_sanitizer/exit_sanitizer.ts
@@ -0,0 +1,11 @@
+Deno.test("exit(0)", function () {
+ Deno.exit(0);
+});
+
+Deno.test("exit(1)", function () {
+ Deno.exit(1);
+});
+
+Deno.test("exit(2)", function () {
+ Deno.exit(2);
+});