mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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. PR-URL: https://github.com/nodejs/node/pull/51205 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
This commit is contained in:
1 parent
12fc7cb18c
commit
0390a1de66
1 file changed
+3
-1
@@ -2,7 +2,7 @@ import { spawnPromisified } from '../common/index.mjs';
|
||||
import * as fixtures from '../common/fixtures.mjs';
|
||||
import assert from 'node:assert';
|
||||
import { execPath } from 'node:process';
|
||||
import { describe, it, test } from 'node:test';
|
||||
import { before, describe, it, test } from 'node:test';
|
||||
|
||||
import { mkdir, rm, writeFile } from 'node:fs/promises';
|
||||
import * as tmpdir from '../common/tmpdir.js';
|
||||
@@ -10,6 +10,8 @@ import * as tmpdir from '../common/tmpdir.js';
|
||||
import secret from '../fixtures/experimental.json' with { type: 'json' };
|
||||
|
||||
describe('ESM: importing JSON', () => {
|
||||
before(() => tmpdir.refresh());
|
||||
|
||||
it('should load JSON', () => {
|
||||
assert.strictEqual(secret.ofLife, 42);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user