Skip to content

Commit 06c14d7

Browse files
committed
test: use tmpdir.refresh() in test-esm-json.mjs
Use `tmpdir.refresh()` in `test/es-module/test-esm-json.mjs` so that the temporary directory is removed when the test exits.
1 parent 2c571c6 commit 06c14d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/es-module/test-esm-json.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import { spawnPromisified } from '../common/index.mjs';
22
import * as fixtures from '../common/fixtures.mjs';
33
import assert from 'node:assert';
44
import { execPath } from 'node:process';
5-
import { describe, it, test } from 'node:test';
5+
import { before, describe, it, test } from 'node:test';
66

77
import { mkdir, rm, writeFile } from 'node:fs/promises';
88
import * as tmpdir from '../common/tmpdir.js';
99

1010
import secret from '../fixtures/experimental.json' with { type: 'json' };
1111

1212
describe('ESM: importing JSON', () => {
13+
before(() => tmpdir.refresh());
14+
1315
it('should load JSON', () => {
1416
assert.strictEqual(secret.ofLife, 42);
1517
});

0 commit comments

Comments
 (0)