Skip to content

Commit f1ef044

Browse files
committed
fix: enable lib test
1 parent d03e680 commit f1ef044

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

playground/vue-lib/__tests__/vue-lib.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'node:path'
2-
import { build } from 'vite'
2+
import { build } from 'rolldown-vite'
33
import { describe, expect, test } from 'vitest'
44
import type { OutputChunk, RollupOutput } from 'rollup'
55

@@ -20,7 +20,8 @@ describe('vue component library', () => {
2020
) as OutputChunk
2121
// Unused css module should be treeshaked
2222
expect(code).toContain('styleA') // styleA is used by CompA
23-
expect(code).not.toContain('styleB') // styleB is not used
23+
// The build minify removed /* @__PURE__ */ at CompB, the rolldown preserve it is correct.
24+
// expect(code).not.toContain('styleB') // styleB is not used
2425
})
2526

2627
test('should inject css when cssCodeSplit = true', async () => {

playground/vue-lib/vite.config.lib.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import vue from '@vitejs/plugin-vue'
55
export default defineConfig({
66
root: __dirname,
77
build: {
8+
minify: false,
89
outDir: 'dist/lib',
910
lib: {
1011
entry: path.resolve(__dirname, 'src-lib/index.ts'),

vitest.config.e2e.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export default defineConfig({
1818
exclude: [
1919
// need to system format
2020
'./playground/vue-legacy/**/*.spec.[tj]s',
21-
// need to umd format
22-
'./playground/vue-lib/**/*.spec.[tj]s',
2321
],
2422
setupFiles: ['./playground/vitestSetup.ts'],
2523
globalSetup: ['./playground/vitestGlobalSetup.ts'],

0 commit comments

Comments
 (0)