diff --git a/package-lock.json b/package-lock.json index 041bf11..7f33dbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.5.0", "license": "MIT", "dependencies": { + "@pokujs/dom": "^1.3.0", "@testing-library/dom": "^10.4.1" }, "devDependencies": { @@ -857,9 +858,9 @@ } }, "node_modules/@pokujs/dom": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@pokujs/dom/-/dom-1.3.0.tgz", - "integrity": "sha512-O7aZdRoeq0FrU5uSIVSA10/pHtVpedmkkVggi3qooGCU8+5SGzAFKYRzlwCwAr3gQjdaU34JqVflNgPmz61JGw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@pokujs/dom/-/dom-1.3.1.tgz", + "integrity": "sha512-ge4Lxx5tLUiiugftvD7Qk6HEPnoY/IRXJ5uOTFLxyEvog2q1wqCUQNLznIA3uvaEjoH+fPwOZgHX3nPqQkrzQg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 0e340a4..d69681c 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "provenance": true }, "dependencies": { + "@pokujs/dom": "^1.3.0", "@testing-library/dom": "^10.4.1" }, "peerDependencies": { @@ -100,7 +101,7 @@ "optional": true } }, - "devDependencies": { +"devDependencies": { "@happy-dom/global-registrator": "^20.8.9", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@pokujs/dom": "^1.3.0", diff --git a/tests/plugin-command.test.ts b/tests/plugin-command.test.ts index a9f6afc..10fa327 100644 --- a/tests/plugin-command.test.ts +++ b/tests/plugin-command.test.ts @@ -59,6 +59,23 @@ test('buildRunnerCommand injects deno preload and avoids duplicates', async () = ]); }); +test('buildRunnerCommand injects --preload for Bun (not --import)', async () => { + const result = buildRunnerCommand({ + runtime: 'bun', + command: ['bun', 'tests/example.test.tsx'], + file: 'tests/example.test.tsx', + domSetupPath: '/tmp/react-dom-setup.ts', + runtimeOptionArgs: [], + }); + + assert.strictEqual(result.shouldHandle, true); + assert.deepStrictEqual(result.command, [ + 'bun', + '--preload /tmp/react-dom-setup.ts', + 'tests/example.test.tsx', + ]); +}); + test('buildRunnerCommand leaves unsupported runtime unchanged', async () => { const original = ['python', 'tests/example.test.tsx']; const result = buildRunnerCommand({ diff --git a/tests/plugin-internals.test.ts b/tests/plugin-internals.test.ts index 465a49a..5a2ee43 100644 --- a/tests/plugin-internals.test.ts +++ b/tests/plugin-internals.test.ts @@ -59,7 +59,7 @@ test('buildRunnerCommand injects dom setup for bun without tsx import', async () assert.strictEqual(result.shouldHandle, true); assert.deepStrictEqual(result.command, [ 'bun', - '--import=/tmp/dom-setup.ts', + '--preload /tmp/dom-setup.ts', 'tests/example.test.tsx', '--poku-react-metrics=1', ]);