Files
cypress/packages/server/test/unit/util/path_helpers_spec.js
T
Tim Griesser e4442ab7ac refactor: remove global.root & usage in require (#19336)
* refactor: remove global.root & use in requires

* fix types
2021-12-11 14:06:49 -05:00

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
})
})
})