11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst fs = require('fs'); 61cb0ef41Sopenharmony_ciconst path = require('path'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst tmpdir = require('../common/tmpdir'); 91cb0ef41Sopenharmony_citmpdir.refresh(); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciconst dirname = path.join(tmpdir.path, '\u4e2d\u6587\u76ee\u5f55'); 121cb0ef41Sopenharmony_cifs.mkdirSync(dirname); 131cb0ef41Sopenharmony_cifs.writeFileSync(path.join(dirname, 'file.js'), 'module.exports = 42;'); 141cb0ef41Sopenharmony_cifs.writeFileSync(path.join(dirname, 'package.json'), 151cb0ef41Sopenharmony_ci JSON.stringify({ name: 'test', main: 'file.js' })); 161cb0ef41Sopenharmony_ciassert.strictEqual(require(dirname), 42); 171cb0ef41Sopenharmony_ciassert.strictEqual(require(path.join(dirname, 'file.js')), 42); 18