Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/src/core/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { expect } from 'chai'
import resolve, { CASE_SENSITIVE_FS, fileExistsWithCaseSync } from 'eslint-module-utils/resolve'
import ModuleCache from 'eslint-module-utils/ModuleCache'

import * as path from 'path'
import * as fs from 'fs'
import * as utils from '../utils'

Expand Down Expand Up @@ -43,6 +44,11 @@ describe('resolve', function () {
expect(fileExistsWithCaseSync(file, ModuleCache.getSettings(testContext)))
.to.be.false
})
it('detecting case does not include parent folder path (issue #720)', function () {
const f = path.join(process.cwd().toUpperCase(), './tests/files/jsx/MyUnCoolComponent.jsx')
expect(fileExistsWithCaseSync(f, ModuleCache.getSettings(testContext), true))
.to.be.true
})
})

describe('rename cache correctness', function () {
Expand Down
1 change: 1 addition & 0 deletions utils/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cache

// null means it resolved to a builtin
if (filepath === null) return true
if (filepath.toLowerCase() === process.cwd().toLowerCase()) return true
const parsedPath = path.parse(filepath)
, dir = parsedPath.dir

Expand Down