-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathstdout_spec.js
78 lines (71 loc) · 2.09 KB
/
stdout_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const systemTests = require('../lib/system-tests').default
describe('e2e stdout', () => {
systemTests.setup({
servers: [{
port: 1777,
https: true,
onServer: (app) => {
app.get('/', (req, res) => {
res.set('content-type', 'text/html').end('it worked')
})
},
}],
settings: {
hosts: {
'www.google.com': '127.0.0.1',
'www.apple.com': '127.0.0.1',
'*.cypress.io': '127.0.0.1',
},
e2e: {},
},
})
it('displays errors from failures', function () {
return systemTests.exec(this, {
port: 2020,
snapshot: true,
spec: 'stdout_failing.cy.js',
expectedExitCode: 3,
onStdout: (stdout) => {
// assert stack trace line numbers/columns mirror source map
expect(stdout).to.include('Context.eval (webpack://e2e/./cypress/e2e/stdout_failing.cy.js:7:12)')
expect(stdout).to.include('Context.eval (webpack://e2e/./cypress/e2e/stdout_failing.cy.js:15:9)')
expect(stdout).to.include('Context.eval (webpack://e2e/./cypress/e2e/stdout_failing.cy.js:27:9)')
},
})
})
it('displays errors from exiting early due to bundle errors', function () {
return systemTests.exec(this, {
spec: 'stdout_exit_early_failing.cy.js',
snapshot: true,
expectedExitCode: 1,
onStdout: systemTests.normalizeWebpackErrors,
})
})
it('does not duplicate suites or tests between visits', function () {
return systemTests.exec(this, {
spec: 'stdout_passing.cy.js',
timeout: 120000,
snapshot: true,
})
})
it('respects quiet mode', function () {
return systemTests.exec(this, {
spec: 'stdout_passing.cy.js',
timeout: 120000,
snapshot: true,
quiet: true,
})
})
it('displays fullname of nested specfile', function () {
return systemTests.exec(this, {
port: 2020,
snapshot: true,
spec: 'nested-1/nested-2/nested-3/**/*',
})
})
systemTests.it('displays assertion errors', {
spec: 'stdout_assertion_errors.cy.js',
snapshot: true,
expectedExitCode: 4,
})
})