Files
cypress/system-tests/test/system_node_spec.js
Lachlan Miller abea165832 fix: do not include non specs when globbing using --spec in run mode (#21462)
* fix: do not include non specs when globbing using --spec in run mode

* update pattern

* fix test

* update cdp spec

* wip - updates

* update snapshots

* update non-proxied spec

* update snaps

* update snaps

* rename specs

* update spec

* wip - snapshots

* snaps

* snaps

* update spec names

* update

* update test

* snaps

* update snap and spec

* snaps

* correct spec pattern

* snaps

* revert

* update spec and snapshots

* fix test

* update tests

* fix test

* update test

* update snapshot

* update snaps

* include coffee in specPattern

* update snapshots

* update snaps

* rename specs

* snaps

* update test

* update snapshot

* update

* snaps

* update snap

* update snaps

* fix test

* unskip test

* snaps

* add test
2022-05-17 18:11:42 +10:00

78 lines
2.2 KiB
JavaScript

const systemTests = require('../lib/system-tests').default
const execa = require('execa')
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: 'system-node',
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: 'system-node',
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: 'system-node',
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')
})
})