Skip to content

Commit 68237c9

Browse files
committed
Use the cy global.
1 parent 6394e7e commit 68237c9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/add-commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {commands} from './'
22

33
commands.forEach(({name, command}) => {
4-
Cypress.Commands.add(name, command.bind(null, cy))
4+
Cypress.Commands.add(name, command)
55
})
66

7-
/* global Cypress, cy */
7+
/* global Cypress */

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const defaults = {
88
const commands = Object.keys(queries).map(queryName => {
99
return {
1010
name: queryName,
11-
command: (cy, ...args) => {
11+
command: (...args) => {
1212
const lastArg = args[args.length - 1]
1313
const waitOptions = (typeof lastArg === 'object')
1414
? Object.assign({}, defaults, lastArg)
@@ -67,4 +67,4 @@ const commands = Object.keys(queries).map(queryName => {
6767
export {commands}
6868

6969
/* eslint no-new-func:0 */
70-
/* globals Cypress */
70+
/* globals Cypress, cy */

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function getFirstElement(jqueryOrElement) {
66
}
77

88
function getContainer(container) {
9-
const withinContainer = Cypress.cy.state('withinSubject')
9+
const withinContainer = cy.state('withinSubject')
1010
if (withinContainer) {
1111
return getFirstElement(withinContainer)
1212
}
@@ -18,4 +18,4 @@ export {
1818
getContainer,
1919
}
2020

21-
/* globals Cypress */
21+
/* globals Cypress, cy */

0 commit comments

Comments
 (0)