forked from web-infra-dev/rstest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.ts
More file actions
29 lines (26 loc) · 918 Bytes
/
Copy pathindex.test.ts
File metadata and controls
29 lines (26 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { describe, it } from '@rstest/core';
import { runRstestCli } from '../scripts/';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
describe('experiments.softMode — happy-dom', () => {
it('resets DOM/storage/prototype state between files (happy-dom env)', async ({
onTestFinished,
}) => {
// Mirrors the jsdom soft-mode fixture for happy-dom. Verifies that
// `softResetEnv` and the prototype-snapshot path handle the
// `happy-dom` env-name branch the same way they handle `jsdom`.
const { expectExecSuccess } = await runRstestCli({
command: 'rstest',
args: ['run'],
onTestFinished,
options: {
nodeOptions: {
cwd: join(__dirname, './fixtures'),
},
},
});
await expectExecSuccess();
});
});