Skip to content

Commit

Permalink
fix: enable lib test
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Dec 12, 2024
1 parent d03e680 commit f1ef044
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions playground/vue-lib/__tests__/vue-lib.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path'
import { build } from 'vite'
import { build } from 'rolldown-vite'
import { describe, expect, test } from 'vitest'
import type { OutputChunk, RollupOutput } from 'rollup'

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

test('should inject css when cssCodeSplit = true', async () => {
Expand Down
1 change: 1 addition & 0 deletions playground/vue-lib/vite.config.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import vue from '@vitejs/plugin-vue'
export default defineConfig({
root: __dirname,
build: {
minify: false,
outDir: 'dist/lib',
lib: {
entry: path.resolve(__dirname, 'src-lib/index.ts'),
Expand Down
2 changes: 0 additions & 2 deletions vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export default defineConfig({
exclude: [
// need to system format
'./playground/vue-legacy/**/*.spec.[tj]s',
// need to umd format
'./playground/vue-lib/**/*.spec.[tj]s',
],
setupFiles: ['./playground/vitestSetup.ts'],
globalSetup: ['./playground/vitestGlobalSetup.ts'],
Expand Down

0 comments on commit f1ef044

Please sign in to comment.