Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
lpinca committed Dec 18, 2023
commit 06c14d7451b4366ac5dd8b1e9a1b3e31c84ff91e
4 changes: 3 additions & 1 deletion test/es-module/test-esm-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ 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';

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);
});
Expand Down