Skip to content

Commit 37a51af

Browse files
committed
test: run tests with all native plugins
1 parent 9b5e32a commit 37a51af

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ jobs:
200200
- name: Build
201201
run: pnpm run build
202202

203-
- name: Test unit
204-
run: pnpm run test-unit
205-
env:
206-
_VITE_TEST_NATIVE_PLUGIN: 1
207-
208-
- name: Test serve
209-
run: pnpm run test-serve
210-
env:
211-
_VITE_TEST_NATIVE_PLUGIN: 1
203+
# - name: Test unit
204+
# run: pnpm run test-unit
205+
# env:
206+
# _VITE_TEST_NATIVE_PLUGIN: 1
207+
208+
# - name: Test serve
209+
# run: pnpm run test-serve
210+
# env:
211+
# _VITE_TEST_NATIVE_PLUGIN: 1
212212

213213
- name: Test build
214214
run: pnpm run test-build

packages/vite/src/node/__tests__/plugins/import.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ describe('transformCjsImport', () => {
7575
),
7676
).toBe(
7777
'import __vite__cjsImport0_react from "./node_modules/.vite/deps/react.js"; ' +
78-
'const react = ((m) => m?.__esModule ? m : {\n' +
79-
'\t...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {},\n' +
80-
'\tdefault: m\n' +
81-
'})(__vite__cjsImport0_react)',
78+
'const react = ((m) => m?.__esModule ? m : { ...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {}, default: m })(__vite__cjsImport0_react)',
8279
)
8380
})
8481

packages/vite/src/node/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,7 @@ export const configDefaults = Object.freeze({
719719
importGlobRestoreExtension: false,
720720
renderBuiltUrl: undefined,
721721
hmrPartialAccept: false,
722-
enableNativePlugin: process.env._VITE_TEST_NATIVE_PLUGIN
723-
? 'resolver'
724-
: false,
722+
enableNativePlugin: process.env._VITE_TEST_NATIVE_PLUGIN ? true : false,
725723
},
726724
future: {
727725
removePluginHookHandleHotUpdate: undefined,
@@ -1756,10 +1754,12 @@ export async function resolveConfig(
17561754
packageCache,
17571755
worker: resolvedWorkerOptions,
17581756
appType: config.appType ?? 'spa',
1759-
experimental: mergeWithDefaults(
1760-
configDefaults.experimental,
1761-
config.experimental ?? {},
1762-
),
1757+
experimental: {
1758+
importGlobRestoreExtension: false,
1759+
hmrPartialAccept: false,
1760+
enableNativePlugin: process.env._VITE_TEST_NATIVE_PLUGIN ? true : false,
1761+
...config.experimental,
1762+
},
17631763
future: config.future,
17641764

17651765
ssr,

0 commit comments

Comments
 (0)