Skip to content

Commit cbba72c

Browse files
authored
test: re-enable some tests for rolldown-vite ecosystem-ci (#639)
1 parent f7cef18 commit cbba72c

File tree

2 files changed

+19
-32
lines changed

2 files changed

+19
-32
lines changed

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

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
import path from 'node:path'
22
import type { Rollup } from 'vite'
33
import { build } from 'vite'
4-
import * as vite from 'vite'
54
import { describe, expect, test } from 'vitest'
65

7-
const isRolldownVite = 'rolldownVersion' in vite
8-
96
describe('vue component library', () => {
10-
// skip this test for now with rolldown-vite due to https://github.com/oxc-project/oxc/issues/10033
11-
test.skipIf(isRolldownVite)(
12-
'should output tree shakeable css module code',
13-
async () => {
14-
// Build lib
15-
await build({
16-
logLevel: 'silent',
17-
configFile: path.resolve(__dirname, '../vite.config.lib.ts'),
18-
})
19-
// Build app
20-
const { output } = (await build({
21-
logLevel: 'silent',
22-
configFile: path.resolve(__dirname, '../vite.config.consumer.ts'),
23-
})) as Rollup.RollupOutput
24-
const { code } = output.find(
25-
(e) => e.type === 'chunk' && e.isEntry,
26-
) as Rollup.OutputChunk
27-
// Unused css module should be treeshaked
28-
expect(code).toContain('styleA') // styleA is used by CompA
29-
expect(code).not.toContain('styleB') // styleB is not used
30-
},
31-
)
7+
test('should output tree shakeable css module code', async () => {
8+
// Build lib
9+
await build({
10+
logLevel: 'silent',
11+
configFile: path.resolve(__dirname, '../vite.config.lib.ts'),
12+
})
13+
// Build app
14+
const { output } = (await build({
15+
logLevel: 'silent',
16+
configFile: path.resolve(__dirname, '../vite.config.consumer.ts'),
17+
})) as Rollup.RollupOutput
18+
const { code } = output.find(
19+
(e) => e.type === 'chunk' && e.isEntry,
20+
) as Rollup.OutputChunk
21+
// Unused css module should be treeshaked
22+
expect(code).toContain('styleA') // styleA is used by CompA
23+
expect(code).not.toContain('styleB') // styleB is not used
24+
})
3225

3326
test('should inject css when cssCodeSplit = true', async () => {
3427
// Build lib

vitest.config.e2e.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { resolve } from 'node:path'
2-
import { defaultExclude, defineConfig } from 'vitest/config'
3-
import * as vite from 'vite'
2+
import { defineConfig } from 'vitest/config'
43

54
const timeout = process.env.CI ? 50000 : 30000
65

@@ -16,11 +15,6 @@ export default defineConfig({
1615
},
1716
test: {
1817
include: ['./playground/**/*.spec.[tj]s'],
19-
exclude: [
20-
...defaultExclude,
21-
// plugin-legacy is not supported with rolldown-vite
22-
...('rolldownVersion' in vite ? ['./playground/vue-legacy/**/*'] : []),
23-
],
2418
setupFiles: ['./playground/vitestSetup.ts'],
2519
globalSetup: ['./playground/vitestGlobalSetup.ts'],
2620
testTimeout: timeout,

0 commit comments

Comments
 (0)