11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_cirequire('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst fs = require('fs'); 51cb0ef41Sopenharmony_ciconst path = require('path'); 61cb0ef41Sopenharmony_ciconst tmpdir = require('../common/tmpdir'); 71cb0ef41Sopenharmony_citmpdir.refresh(); 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ciconst filePath = path.join(tmpdir.path, 'test-module-cache.json'); 101cb0ef41Sopenharmony_ciassert.throws( 111cb0ef41Sopenharmony_ci () => require(filePath), 121cb0ef41Sopenharmony_ci { code: 'MODULE_NOT_FOUND' } 131cb0ef41Sopenharmony_ci); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_cifs.writeFileSync(filePath, '[]'); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciconst content = require(filePath); 181cb0ef41Sopenharmony_ciassert.strictEqual(Array.isArray(content), true); 191cb0ef41Sopenharmony_ciassert.strictEqual(content.length, 0); 20