node/test/parallel/test-require-resolve.js
blugavere 920737180f test: refactor test-require-resolve
* var => const
* assert.equal() => assert.strictEqual()

PR-URL: https://github.com/nodejs/node/pull/10120
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-20 17:11:59 -05:00

18 lines
662 B
JavaScript

'use strict';
const common = require('../common');
const fixturesDir = common.fixturesDir;
const assert = require('assert');
const path = require('path');
assert.strictEqual(
path.join(__dirname, '../fixtures/a.js').toLowerCase(),
require.resolve('../fixtures/a').toLowerCase());
assert.strictEqual(
path.join(fixturesDir, 'a.js').toLowerCase(),
require.resolve(path.join(fixturesDir, 'a')).toLowerCase());
assert.strictEqual(
path.join(fixturesDir, 'nested-index', 'one', 'index.js').toLowerCase(),
require.resolve('../fixtures/nested-index/one').toLowerCase());
assert.strictEqual('path', require.resolve('path'));
console.log('ok');