summaryrefslogtreecommitdiff
path: root/tests/specs/test/junit_nested
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/test/junit_nested')
-rw-r--r--tests/specs/test/junit_nested/__test__.jsonc5
-rw-r--r--tests/specs/test/junit_nested/main.out47
-rw-r--r--tests/specs/test/junit_nested/main.ts23
3 files changed, 75 insertions, 0 deletions
diff --git a/tests/specs/test/junit_nested/__test__.jsonc b/tests/specs/test/junit_nested/__test__.jsonc
new file mode 100644
index 000000000..79b73474d
--- /dev/null
+++ b/tests/specs/test/junit_nested/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "test --reporter junit main.ts",
+ "exitCode": 1,
+ "output": "main.out"
+}
diff --git a/tests/specs/test/junit_nested/main.out b/tests/specs/test/junit_nested/main.out
new file mode 100644
index 000000000..f2ac00f29
--- /dev/null
+++ b/tests/specs/test/junit_nested/main.out
@@ -0,0 +1,47 @@
+Check file:///[WILDCARD]/main.ts
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuites name="deno test" tests="11" failures="6" errors="0" time="[WILDCARD]">
+ <testsuite name="./main.ts" tests="11" disabled="0" errors="0" failures="6">
+ <testcase name="parent 1" classname="./main.ts" time="[WILDCARD]" line="1" col="6">
+ <failure message="1 test step failed">1 test step failed.</failure>
+ </testcase>
+ <testcase name="parent 2" classname="./main.ts" time="[WILDCARD]" line="8" col="6">
+ <failure message="2 test steps failed">2 test steps failed.</failure>
+ </testcase>
+ <testcase name="parent 3" classname="./main.ts" time="[WILDCARD]" line="20" col="6">
+ </testcase>
+ <testcase name="parent 1 &gt; child 1" classname="./main.ts" time="[WILDCARD]" line="2" col="11">
+ </testcase>
+ <testcase name="parent 1 &gt; child 2" classname="./main.ts" time="[WILDCARD]" line="3" col="11">
+ <failure message="Uncaught Error: Fail.">Error: Fail.
+ throw new Error(&quot;Fail.&quot;);
+ ^
+ at file:///[WILDCARD]/main.ts:4:11
+ [WILDCARD]</failure>
+ </testcase>
+ <testcase name="parent 2 &gt; child 1" classname="./main.ts" time="[WILDCARD]" line="9" col="11">
+ <failure message="1 test step failed">1 test step failed.</failure>
+ </testcase>
+ <testcase name="parent 2 &gt; child 1 &gt; grandchild 1" classname="[WILDCARD]/main.ts" time="[WILDCARD]" line="10" col="13">
+ </testcase>
+ <testcase name="parent 2 &gt; child 1 &gt; grandchild 2" classname="[WILDCARD]/main.ts" time="[WILDCARD]" line="11" col="13">
+ <failure message="Uncaught Error: Fail.">Error: Fail.
+ throw new Error(&quot;Fail.&quot;);
+ ^
+ at file:///[WILDCARD]/main.ts:12:13
+ [WILDCARD]</failure>
+ </testcase>
+ <testcase name="parent 2 &gt; child 2" classname="./main.ts" time="[WILDCARD]" line="15" col="11">
+ <failure message="Uncaught Error: Fail.">Error: Fail.
+ throw new Error(&quot;Fail.&quot;);
+ ^
+ at file:///[WILDCARD]/main.ts:16:11
+ [WILDCARD]</failure>
+ </testcase>
+ <testcase name="parent 3 &gt; child 1" classname="./main.ts" time="[WILDCARD]" line="21" col="11">
+ </testcase>
+ <testcase name="parent 3 &gt; child 2" classname="./main.ts" time="[WILDCARD]" line="22" col="11">
+ </testcase>
+ </testsuite>
+</testsuites>
+error: Test failed
diff --git a/tests/specs/test/junit_nested/main.ts b/tests/specs/test/junit_nested/main.ts
new file mode 100644
index 000000000..128e48aef
--- /dev/null
+++ b/tests/specs/test/junit_nested/main.ts
@@ -0,0 +1,23 @@
+Deno.test("parent 1", async (t) => {
+ await t.step("child 1", () => {});
+ await t.step("child 2", () => {
+ throw new Error("Fail.");
+ });
+});
+
+Deno.test("parent 2", async (t) => {
+ await t.step("child 1", async (t) => {
+ await t.step("grandchild 1", () => {});
+ await t.step("grandchild 2", () => {
+ throw new Error("Fail.");
+ });
+ });
+ await t.step("child 2", () => {
+ throw new Error("Fail.");
+ });
+});
+
+Deno.test("parent 3", async (t) => {
+ await t.step("child 1", () => {});
+ await t.step("child 2", () => {});
+});