Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit 4edb1ea

Browse files
committed
test: enhance tests
1 parent f00d27b commit 4edb1ea

File tree

5 files changed

+57
-10
lines changed

5 files changed

+57
-10
lines changed

__snapshots__/cypress.spec.ts.js

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ exports['cypress - e2e test: cypress integration 1'] = `
77
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
88
│ Cypress: *.*.* │
99
│ Browser: Electron ** (headless) │
10-
│ Specs: 3 found (compile-error.spec.js, fail.spec.js, success.spec..js) │
10+
│ Specs: 4 found (compile-error.spec.js, fail.spec.js, runtime-error.spec.js, success.spec. │
11+
│ js) │
1112
└────────────────────────────────────────────────────────────────────────────────────────────────┘
1213
1314
1415
────────────────────────────────────────────────────────────────────────────────────────────────────
1516
16-
Running: compile-error.spec.js (1 of 3)
17+
Running: compile-error.spec.js (1 of 4)
1718
1819
Oops...we found an error preparing this test file:
1920
@@ -47,7 +48,7 @@ Fix the error in your code and re-run your tests.
4748
4849
────────────────────────────────────────────────────────────────────────────────────────────────────
4950
50-
Running: fail.spec.js (2 of 3)
51+
Running: fail.spec.js (2 of 4)
5152
5253
5354
foo
@@ -86,11 +87,46 @@ Fix the error in your code and re-run your tests.
8687
8788
────────────────────────────────────────────────────────────────────────────────────────────────────
8889
89-
Running: success.spec..js (3 of 3)
90+
Running: runtime-error.spec.js (3 of 4)
9091
9192
9293
foo
93-
✓ runs (***ms)
94+
1) has runtime error
95+
96+
97+
0 passing (***ms)
98+
1 failing
99+
100+
1) foo
101+
has runtime error:
102+
Error: error thrown on purpose
103+
at Context.eval (http://localhost:****/__cypress/tests?p=cypress/integration/runtime-error.spec.js:8:13)
104+
105+
106+
107+
108+
(Results)
109+
110+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
111+
│ Tests: 1 │
112+
│ Passing: 0 │
113+
│ Failing: 1 │
114+
│ Pending: 0 │
115+
│ Skipped: 0 │
116+
│ Screenshots: 0 │
117+
│ Video: false │
118+
│ Duration: 0 seconds │
119+
│ Spec Ran: runtime-error.spec.js │
120+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
121+
122+
123+
────────────────────────────────────────────────────────────────────────────────────────────────────
124+
125+
Running: success.spec.js (4 of 4)
126+
127+
128+
foo
129+
✓ works (***ms)
94130
95131
96132
1 passing (***ms)
@@ -107,7 +143,7 @@ Fix the error in your code and re-run your tests.
107143
│ Screenshots: 0 │
108144
│ Video: false │
109145
│ Duration: 0 seconds │
110-
│ Spec Ran: success.spec..js
146+
│ Spec Ran: success.spec.js
111147
└────────────────────────────────────────────────────────────────────────────────────────────────┘
112148
113149
@@ -122,9 +158,11 @@ Fix the error in your code and re-run your tests.
122158
├────────────────────────────────────────────────────────────────────────────────────────────────┤
123159
│ ✖ fail.spec.js ***ms 1 - 1 - - │
124160
├────────────────────────────────────────────────────────────────────────────────────────────────┤
125-
│ ✔ success.spec..js ***ms 1 1 - - - │
161+
│ ✖ runtime-error.spec.js ***ms 1 - 1 - - │
162+
├────────────────────────────────────────────────────────────────────────────────────────────────┤
163+
│ ✔ success.spec.js ***ms 1 1 - - - │
126164
└────────────────────────────────────────────────────────────────────────────────────────────────┘
127-
2 of 3 failed (67%) ***ms 2 1 2 - -
165+
3 of 4 failed (75%) ***ms 3 1 3 - -
128166
129167
130168
`

cypress/integration/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

cypress/integration/.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ignorePatterns": [
3+
"compile-error.spec.js"
4+
]
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('foo', () => {
2+
it('has runtime error', () => {
3+
throw new Error('error thrown on purpose')
4+
})
5+
})
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('foo', () => {
2-
it('runs', () => {
2+
it('works', () => {
33
expect(1).to.be.greaterThan(0)
44
})
55
})

0 commit comments

Comments
 (0)