mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 20:39:30 +00:00

Use assert.strictEqual instead of assert.equal in tests, manually convert types where necessary. PR-URL: https://github.com/nodejs/node/pull/10698 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
17 lines
562 B
JavaScript
17 lines
562 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
const dirname = path.join(common.tmpDir, '\u4e2d\u6587\u76ee\u5f55');
|
|
fs.mkdirSync(dirname);
|
|
fs.writeFileSync(path.join(dirname, 'file.js'), 'module.exports = 42;');
|
|
fs.writeFileSync(path.join(dirname, 'package.json'),
|
|
JSON.stringify({ name: 'test', main: 'file.js' }));
|
|
assert.strictEqual(require(dirname), 42);
|
|
assert.strictEqual(require(path.join(dirname, 'file.js')), 42);
|