diff --git a/tests/src/core/resolve.js b/tests/src/core/resolve.js index 02a2177c60..06063790b0 100644 --- a/tests/src/core/resolve.js +++ b/tests/src/core/resolve.js @@ -340,8 +340,10 @@ describe('resolve', function () { expect(fileExistsWithCaseSync(f, testSettings)) .to.be.true; }); - it('detecting case should include parent folder path', function () { + it.only('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 ec9397fa14..ade62b81e1 100644 --- a/utils/resolve.js +++ b/utils/resolve.js @@ -55,21 +55,28 @@ 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) return result; + if (result != null) { + console.log('result', result); + 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 {