refactor: replace fs-extra with node:fs (#1772)

* spec: add devDependencies "tmp"
This commit is contained in:
エリス
2025-01-29 10:39:11 +09:00
committed by GitHub
parent b623311efa
commit e012478537
20 changed files with 188 additions and 164 deletions

View File

@@ -18,7 +18,7 @@
*/
const os = require('node:os');
const fs = require('fs-extra');
const fs = require('node:fs');
const path = require('node:path');
const { EventEmitter } = require('events');
const { ConfigParser, PluginInfoProvider } = require('cordova-common');
@@ -49,14 +49,15 @@ describe('E2E', function () {
api = await makeProject(projectPath);
});
afterEach(() => {
fs.removeSync(tmpDir);
fs.rmSync(tmpDir, { recursive: true, force: true });
});
it('loads the API from a project directory', async () => {
// Allow test project to find the `cordova-android` module
fs.ensureSymlinkSync(
path.join(__dirname, '../..'),
path.join(tmpDir, 'node_modules/cordova-android'),
fs.mkdirSync(path.join(tmpDir, 'node_modules'), { recursive: true });
fs.symlinkSync(
path.join(__dirname, '..', '..'),
path.join(tmpDir, 'node_modules', 'cordova-android'),
'junction'
);