forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem_node_spec.js
More file actions
80 lines (67 loc) · 2.27 KB
/
Copy pathsystem_node_spec.js
File metadata and controls
80 lines (67 loc) · 2.27 KB
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
79
80
const systemTests = require('../lib/system-tests').default
const execa = require('execa')
const Fixtures = require('../lib/fixtures')
const systemNode = Fixtures.projectPath('system-node')
let expectedNodeVersion
let expectedNodePath
describe('e2e system node', () => {
before(async () => {
// Grab the system node version and path before running the tests.
expectedNodeVersion = (await execa('node', ['-v'])).stdout.slice(1)
expectedNodePath = (await execa('node', ['-e', 'console.log(process.execPath)'])).stdout
})
systemTests.setup()
it('uses system node when launching plugins file', async function () {
const { stderr } = await systemTests.exec(this, {
project: systemNode,
userNodePath: expectedNodePath,
userNodeVersion: expectedNodeVersion,
config: {
nodeVersion: 'system',
env: {
expectedNodeVersion,
expectedNodePath,
},
},
spec: 'system.spec.js',
sanitizeScreenshotDimensions: true,
snapshot: true,
})
expect(stderr).to.contain(`Plugin Node version: ${expectedNodeVersion}`)
expect(stderr).to.contain('Plugin Electron version: undefined')
})
it('uses bundled node when launching plugins file', async function () {
const { stderr } = await systemTests.exec(this, {
project: systemNode,
config: {
nodeVersion: 'bundled',
env: {
expectedNodeVersion,
},
},
spec: 'bundled.spec.js',
sanitizeScreenshotDimensions: true,
snapshot: true,
})
expect(stderr).to.contain(`Plugin Node version: ${expectedNodeVersion}`)
expect(stderr).to.not.contain('Plugin Electron version: undefined')
})
it('uses default node when launching plugins file', async function () {
const { stderr } = await systemTests.exec(this, {
project: systemNode,
userNodePath: expectedNodePath,
userNodeVersion: expectedNodeVersion,
config: {
env: {
expectedNodeVersion,
expectedNodePath,
},
},
spec: 'default.spec.js',
sanitizeScreenshotDimensions: true,
snapshot: true,
})
expect(stderr).to.contain(`Plugin Node version: ${expectedNodeVersion}`)
expect(stderr).to.contain('Plugin Electron version: undefined')
})
})