mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 01:31:27 +00:00

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>
24 lines
488 B
JavaScript
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);
|
|
}
|