Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should resolve node paths', () => {
const cs = createConfigSet({ jestConfig: { rootDir: '/root', cwd: '/cwd' } as any, resolve: null })
const doResolve = (path: string) => cs.resolvePath(path, { throwIfMissing: false, nodeResolve: true })
expect(doResolve('json5')).toBe(resolve(__dirname, '../../node_modules/json5', require('json5/package.json').main))
expect(doResolve('./bar.js')).toBe(resolve('/cwd/bar.js'))
expect(doResolve('bar.js')).toBe(resolve('/root/bar.js'))
expect(doResolve('/bar.js')).toBe(resolve('/root//bar.js'))
})
it('should throw for invalid paths', () => {