Skip to content

Commit 15d261c

Browse files
committed
Add tests
Also changed empty test duration to output `0` for consistency.
1 parent fb71f4b commit 15d261c

22 files changed

+2097
-330
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-18.04
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-node@v1
10+
with:
11+
node-version: "12.x"
12+
registry-url: https://registry.npmjs.org/
13+
- uses: actions/cache@v1
14+
with:
15+
path: node_modules
16+
key: yarn-${{ hashFiles('yarn.lock') }}
17+
restore-keys: |
18+
yarn-
19+
- run: yarn install --frozen-lockfile
20+
- run: yarn test
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
<DESCRIBE::>group 1
3+
4+
<IT::>test 1
5+
6+
<PASSED::>Test Passed
7+
8+
<COMPLETEDIN::>1
9+
10+
<IT::>test 2
11+
12+
<PASSED::>Test Passed
13+
14+
<COMPLETEDIN::>0
15+
16+
<COMPLETEDIN::>

fixtures/group-passing-failing.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
describe("group 1", () => {
2+
test("test 1", () => {
3+
expect(1).toBe(1);
4+
});
5+
test("test 2", () => {
6+
expect(1).toBe(1);
7+
});
8+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
<DESCRIBE::>group 1
3+
4+
<IT::>test 1
5+
6+
<PASSED::>Test Passed
7+
8+
<COMPLETEDIN::>1
9+
10+
<COMPLETEDIN::>
11+
12+
<DESCRIBE::>group 2
13+
14+
<IT::>test 1
15+
16+
<PASSED::>Test Passed
17+
18+
<COMPLETEDIN::>1
19+
20+
<COMPLETEDIN::>

fixtures/multiple-groups.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe("group 1", () => {
2+
test("test 1", () => {
3+
expect(1).toBe(1);
4+
});
5+
});
6+
7+
describe("group 2", () => {
8+
test("test 1", () => {
9+
expect(1).toBe(1);
10+
});
11+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
<DESCRIBE::>group 1
3+
4+
<DESCRIBE::>group 1 1
5+
6+
<IT::>test 1
7+
8+
<PASSED::>Test Passed
9+
10+
<COMPLETEDIN::>1
11+
12+
<COMPLETEDIN::>
13+
14+
<COMPLETEDIN::>

fixtures/nested-groups.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe("group 1", () => {
2+
describe("group 1 1", () => {
3+
test("test 1", () => {
4+
expect(1).toBe(1);
5+
});
6+
});
7+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
<DESCRIBE::>group 1
3+
4+
<IT::>test 1
5+
6+
<FAILED::>Test Failed
7+
8+
<LOG:HTML:Failure><pre class="ansi"><code>Error: expect(received).toBe(expected) // Object.is equality<:LF:><:LF:>Expected: 2<:LF:>Received: 1</code></pre>
9+
10+
<COMPLETEDIN::>3
11+
12+
<COMPLETEDIN::>
13+
14+
<LOG:HTML:Failures><pre class="ansi"><code>● group 1 › test 1<:LF:><:LF:> expect(received).toBe(expected) // Object.is equality<:LF:><:LF:> Expected: 2<:LF:> Received: 1<:LF:><:LF:> 1 | describe("group 1", () =&gt; {<:LF:> 2 | test("test 1", () =&gt; {<:LF:> &gt; 3 | expect(1).toBe(2);<:LF:> | ^<:LF:> 4 | });<:LF:> 5 | });<:LF:> 6 | <:LF:><:LF:> at Object.&lt;anonymous&gt; (fixtures/single-group-failing.js:3:15)</code></pre>

fixtures/single-group-failing.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe("group 1", () => {
2+
test("test 1", () => {
3+
expect(1).toBe(2);
4+
});
5+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
<DESCRIBE::>group 1
3+
4+
<IT::>test 1
5+
6+
<PASSED::>Test Passed
7+
8+
<COMPLETEDIN::>2
9+
10+
<COMPLETEDIN::>

0 commit comments

Comments
 (0)