File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
const { defineConfig} = require ( 'cypress' )
2
2
3
3
module . exports = defineConfig ( {
4
+ e2e : { } ,
4
5
video : false ,
5
6
} )
Original file line number Diff line number Diff line change 44
44
"@testing-library/dom" : " ^8.1.0"
45
45
},
46
46
"devDependencies" : {
47
- "cypress" : " ^10. 0.0" ,
47
+ "cypress" : " https://cdn.cypress.io/beta/npm/12. 0.0/linux-x64/release/12.0.0-cc63b13085591b70826c909119784e7d358ea56e/cypress.tgz " ,
48
48
"kcd-scripts" : " ^11.2.0" ,
49
49
"npm-run-all" : " ^4.1.5" ,
50
50
"typescript" : " ^4.3.5"
Original file line number Diff line number Diff line change @@ -2,16 +2,17 @@ import {commands} from '../'
2
2
3
3
test ( 'adds commands to Cypress' , ( ) => {
4
4
const addMock = jest . fn ( ) . mockName ( 'Cypress.Commands.add' )
5
- global . Cypress = { Commands : { add : addMock } }
5
+ const addQueryMock = jest . fn ( ) . mockName ( 'Cypress.Commands.addQuery' )
6
+ global . Cypress = { Commands : { add : addMock , addQuery : addQueryMock } }
6
7
global . cy = { }
7
8
8
9
require ( '../add-commands' )
9
10
10
- expect ( addMock ) . toHaveBeenCalledTimes ( commands . length + 1 ) // we're also adding a configuration command
11
+ expect ( addQueryMock ) . toHaveBeenCalledTimes ( commands . length )
12
+ expect ( addMock ) . toHaveBeenCalledTimes ( 1 ) // we're also adding a configuration command
11
13
commands . forEach ( ( { name} , index ) => {
12
- expect ( addMock . mock . calls [ index ] ) . toMatchObject ( [
14
+ expect ( addQueryMock . mock . calls [ index ] ) . toMatchObject ( [
13
15
name ,
14
- { } ,
15
16
// We get a new function that is `command.bind(null, cy)` i.e. global `cy` passed into the first argument.
16
17
// The commands themselves will be tested separately in the Cypress end-to-end tests.
17
18
expect . any ( Function ) ,
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ function getFirstElement(jqueryOrElement) {
7
7
8
8
export { getFirstElement }
9
9
10
- /* globals Cypress, cy */
10
+ /* globals Cypress */
You can’t perform that action at this time.
0 commit comments