2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00
Files
axios/tests/module/esm/tests/fixture-cleanup.module.test.js
T
Jay 76794ac27a chore: update module test for full check (#7510)
* chore: add additional testing to esm and cjs smoke

* test: updated test suite to include module tests

* fix: esm test smoke import

* fix: cubic feedback

* fix: failing cjs

* fix: cjs timeout
2026-03-15 21:10:52 +02:00

26 lines
808 B
JavaScript

import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { describe, expect, it } from 'vitest';
import { cleanupTempFixture } from './helpers/fixture.js';
describe('module fixture cleanup helper', () => {
it('removes fixture directories without shelling out to rm', () => {
const fixturePath = fs.mkdtempSync(path.join(os.tmpdir(), 'axios-esm-module-fixture-'));
const nestedPath = path.join(fixturePath, 'nested');
const originalPath = process.env.PATH;
fs.mkdirSync(nestedPath);
fs.writeFileSync(path.join(nestedPath, 'index.ts'), 'export {};\n');
process.env.PATH = '';
try {
cleanupTempFixture(fixturePath);
} finally {
process.env.PATH = originalPath;
}
expect(fs.existsSync(fixturePath)).toBe(false);
});
});