summaryrefslogtreecommitdiff
path: root/tests/specs/test/non_error_thrown
diff options
context:
space:
mode:
authorHasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>2024-09-16 22:38:40 +0300
committerGitHub <noreply@github.com>2024-09-16 19:38:40 +0000
commite0b9c745c15720914f14996bf357d5b375e2dbd8 (patch)
tree0dfc717082bedb2eec13eceb5cdeb1ef12b8f7f5 /tests/specs/test/non_error_thrown
parent6ce16145dd12d8a272cb543871276c33c8201a37 (diff)
chore: deprecate test itests (#25512)
This PR is part of #22907 --------- Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/specs/test/non_error_thrown')
-rw-r--r--tests/specs/test/non_error_thrown/__test__.jsonc5
-rw-r--r--tests/specs/test/non_error_thrown/main.out40
-rw-r--r--tests/specs/test/non_error_thrown/main.ts23
3 files changed, 68 insertions, 0 deletions
diff --git a/tests/specs/test/non_error_thrown/__test__.jsonc b/tests/specs/test/non_error_thrown/__test__.jsonc
new file mode 100644
index 000000000..a02376f87
--- /dev/null
+++ b/tests/specs/test/non_error_thrown/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "test --quiet main.ts",
+ "exitCode": 1,
+ "output": "main.out"
+}
diff --git a/tests/specs/test/non_error_thrown/main.out b/tests/specs/test/non_error_thrown/main.out
new file mode 100644
index 000000000..7e0de8028
--- /dev/null
+++ b/tests/specs/test/non_error_thrown/main.out
@@ -0,0 +1,40 @@
+running 6 tests from [WILDCARD]/main.ts
+foo ... FAILED ([WILDCARD])
+bar ... FAILED ([WILDCARD])
+baz ... FAILED ([WILDCARD])
+qux ... FAILED ([WILDCARD])
+quux ... FAILED ([WILDCARD])
+quuz ... FAILED ([WILDCARD])
+
+ ERRORS
+
+foo => [WILDCARD]/main.ts:1:6
+error: undefined
+
+bar => [WILDCARD]/main.ts:5:6
+error: null
+
+baz => [WILDCARD]/main.ts:9:6
+error: 123
+
+qux => [WILDCARD]/main.ts:13:6
+error: "Hello, world!"
+
+quux => [WILDCARD]/main.ts:17:6
+error: [ 1, 2, 3 ]
+
+quuz => [WILDCARD]/main.ts:21:6
+error: { a: "Hello, world!", b: [ 1, 2, 3 ] }
+
+ FAILURES
+
+foo => [WILDCARD]/main.ts:1:6
+bar => [WILDCARD]/main.ts:5:6
+baz => [WILDCARD]/main.ts:9:6
+qux => [WILDCARD]/main.ts:13:6
+quux => [WILDCARD]/main.ts:17:6
+quuz => [WILDCARD]/main.ts:21:6
+
+FAILED | 0 passed | 6 failed ([WILDCARD])
+
+error: Test failed
diff --git a/tests/specs/test/non_error_thrown/main.ts b/tests/specs/test/non_error_thrown/main.ts
new file mode 100644
index 000000000..85dc8d179
--- /dev/null
+++ b/tests/specs/test/non_error_thrown/main.ts
@@ -0,0 +1,23 @@
+Deno.test("foo", () => {
+ throw undefined;
+});
+
+Deno.test("bar", () => {
+ throw null;
+});
+
+Deno.test("baz", () => {
+ throw 123;
+});
+
+Deno.test("qux", () => {
+ throw "Hello, world!";
+});
+
+Deno.test("quux", () => {
+ throw [1, 2, 3];
+});
+
+Deno.test("quuz", () => {
+ throw { a: "Hello, world!", b: [1, 2, 3] };
+});