Skip to content

Commit a65adaf

Browse files
committed
test-require-resolve: use case insensitive compare
The test fixtures directory is derived from the path to the currently running script, which is itself specified on the command line. That means that the case of the fixtures dir may not match what the test expects (when executed on a case-insensitive file system). PR-URL: nodejs/node#116 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 2bec35e commit a65adaf

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/simple/test-require-resolve.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ var fixturesDir = common.fixturesDir;
2424
var assert = require('assert');
2525
var path = require('path');
2626

27-
assert.equal(path.join(__dirname, '../fixtures/a.js'),
28-
path.normalize(require.resolve('../fixtures/a')));
29-
assert.equal(path.join(fixturesDir, 'a.js'),
30-
path.normalize(require.resolve(path.join(fixturesDir, 'a'))));
31-
assert.equal(path.join(fixturesDir, 'nested-index', 'one', 'index.js'),
32-
path.normalize(require.resolve('../fixtures/nested-index/one')));
27+
assert.equal(
28+
path.join(__dirname, '../fixtures/a.js').toLowerCase(),
29+
require.resolve('../fixtures/a').toLowerCase());
30+
assert.equal(
31+
path.join(fixturesDir, 'a.js').toLowerCase(),
32+
require.resolve(path.join(fixturesDir, 'a')).toLowerCase());
33+
assert.equal(
34+
path.join(fixturesDir, 'nested-index', 'one', 'index.js').toLowerCase(),
35+
require.resolve('../fixtures/nested-index/one').toLowerCase());
3336
assert.equal('path', require.resolve('path'));
3437

3538
console.log('ok');

0 commit comments

Comments
 (0)