node/test/parallel/test-require-cache.js
cjihrig 4a408321d9 test: cleanup IIFE tests
A number of test files use IIFEs to separate distinct tests from
each other in the same file. The project has been moving toward
using block scopes and let/const in favor of IIFEs. This commit
moves IIFE tests to block scopes. Some additional cleanup such
as use of strictEqual() and common.mustCall() is also included.

PR-URL: https://github.com/nodejs/node/pull/7694
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-07-14 22:07:14 -04:00

24 lines
488 B
JavaScript

'use strict';
require('../common');
var assert = require('assert');
{
const relativePath = '../fixtures/semicolon';
const absolutePath = require.resolve(relativePath);
const fakeModule = {};
require.cache[absolutePath] = {exports: fakeModule};
assert.strictEqual(require(relativePath), fakeModule);
}
{
const relativePath = 'fs';
const fakeModule = {};
require.cache[relativePath] = {exports: fakeModule};
assert.strictEqual(require(relativePath), fakeModule);
}