forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins_spec.js
More file actions
43 lines (35 loc) · 1.1 KB
/
plugins_spec.js
File metadata and controls
43 lines (35 loc) · 1.1 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
require('../spec_helper')
const plugins = require('../../lib/plugins')
const Fixtures = require('@tooling/system-tests/lib/fixtures')
const pluginsFile = Fixtures.projectPath('plugin-before-browser-launch-deprecation/cypress/plugins/index.js')
describe('lib/plugins', () => {
beforeEach(() => {
Fixtures.scaffold()
})
afterEach(() => {
Fixtures.remove()
})
it('prints deprecation message if before:browser:launch argument is mutated as array', () => {
const onWarning = sinon.stub()
const projectConfig = {
pluginsFile,
env: {
BEFORE_BROWSER_LAUNCH_HANDLER: 'return-array-mutation',
},
}
const options = {
onWarning,
testingType: 'e2e',
}
return plugins.init(projectConfig, options)
.then(() => {
return plugins.execute('before:browser:launch', {}, {
args: [],
})
})
.then(() => {
expect(onWarning).to.be.calledOnce
expect(onWarning.firstCall.args[0].message).to.include('Deprecation Warning: The `before:browser:launch` plugin event changed its signature in version `4.0.0`')
})
})
})