nodejs/test/parallel/test-require-resolve.js

19 lines
662 B
JavaScript
Raw Normal View History

'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'));
2010-12-05 01:45:52 +03:00
console.log('ok');