Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cy.route2 recipe #555

Merged
merged 13 commits into from
Sep 9, 2020
Prev Previous commit
Next Next commit
normalize path in require fixtures spec
  • Loading branch information
bahmutov committed Sep 9, 2020
commit 6516fbc25c125c255e28ed6a300d1b82f0cf676f
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// which is "loaded" once
const city = require('../fixtures/city.json')
const country = require('../fixtures/country.json')
const path = require('path')

describe('requires fixtures', () => {
it('has city', () => {
Expand All @@ -19,13 +20,16 @@ describe('requires fixtures', () => {

it('has __dirname', () => {
expect(__dirname).to.be.a('string')
expect(__dirname).to.equal('cypress/integration')
// on Windows OS the directory is "cypress\integration"
// on other operating systems it is "cypress/integration"
// use path.join to be cross-platform
expect(__dirname).to.equal(path.join('cypress', 'integration'))
})

it('has __filename', () => {
expect(__filename).to.be.a('string')
expect(__filename).to.equal(
'cypress/integration/require-fixtures-spec.js'
path.join('cypress', 'integration', 'require-fixtures-spec.js')
)
})
})
Expand Down