mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-04 05:50:47 -05:00
e4442ab7ac
* refactor: remove global.root & use in requires * fix types
22 lines
594 B
JavaScript
22 lines
594 B
JavaScript
require('../../spec_helper')
|
|
|
|
const path_helpers = require(`../../../lib/util/path_helpers`)
|
|
|
|
describe('lib/util/path_helpers', () => {
|
|
context('checkIfResolveChangedRootFolder', () => {
|
|
const check = path_helpers.checkIfResolveChangedRootFolder
|
|
|
|
it('ignores non-absolute paths', () => {
|
|
expect(check('foo/index.js', 'foo')).to.be.false
|
|
})
|
|
|
|
it('handles paths that do not switch', () => {
|
|
expect(check('/foo/index.js', '/foo')).to.be.false
|
|
})
|
|
|
|
it('detects path switch', () => {
|
|
expect(check('/private/foo/index.js', '/foo')).to.be.true
|
|
})
|
|
})
|
|
})
|