diff --git a/tests/src/core/resolve.js b/tests/src/core/resolve.js index c8b866813b..360d4a2e70 100644 --- a/tests/src/core/resolve.js +++ b/tests/src/core/resolve.js @@ -340,10 +340,8 @@ describe('resolve', function () { expect(fileExistsWithCaseSync(f, testSettings)) .to.be.true; }); - it.only('detecting case should include parent folder path', function () { + it('detecting case should include parent folder path', function () { const f = path.join(process.cwd().toUpperCase(), './tests/files/jsx/MyUnCoolComponent.jsx'); - console.log(process.cwd()); - console.log(f); expect(fileExistsWithCaseSync(f, testSettings, true)) .to.be.false; }); diff --git a/utils/resolve.js b/utils/resolve.js index ade62b81e1..ec9397fa14 100644 --- a/utils/resolve.js +++ b/utils/resolve.js @@ -55,28 +55,21 @@ function tryRequire(target, sourceFile) { exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings, strict) { // don't care if the FS is case-sensitive if (CASE_SENSITIVE_FS) return true; - console.log('case insensitive'); + // null means it resolved to a builtin if (filepath === null) return true; if (filepath.toLowerCase() === process.cwd().toLowerCase() && !strict) return true; const parsedPath = path.parse(filepath); - console.log('parsedPath', parsedPath); const dir = parsedPath.dir; let result = fileExistsCache.get(filepath, cacheSettings); - if (result != null) { - console.log('result', result); - return result; - } + if (result != null) return result; // base case if (dir === '' || parsedPath.root === filepath) { - console.log('dir', dir); - console.log('parsedPath.root', parsedPath.root); result = true; } else { const filenames = fs.readdirSync(dir); - console.log('filenames:', filenames); if (filenames.indexOf(parsedPath.base) === -1) { result = false; } else {