mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
76794ac27a
* 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
26 lines
808 B
JavaScript
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);
|
|
});
|
|
});
|