Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: actually build
  • Loading branch information
hi-ogawa committed Sep 17, 2025
commit b80320e0ef09879e11312657f2853c652305d221
31 changes: 30 additions & 1 deletion packages/vite/src/node/__tests__/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,9 @@ test.for([true, false])(
)

test('sharedConfigBuild and emitAssets', async () => {
const root = resolve(__dirname, 'fixtures/shared-config-build/emitAssets')
const builder = await createBuilder({
root: resolve(__dirname, 'fixtures/shared-config-build'),
root,
logLevel: 'warn',
configFile: false,
environments: {
Expand Down Expand Up @@ -909,6 +910,34 @@ test('sharedConfigBuild and emitAssets', async () => {
builder.environments.ssr.config.build.emitAssets,
builder.environments.custom.config.build.emitAssets,
]).toEqual([true, true, true])

await builder.buildApp()

expect(
await Promise.all([
fsp.readdir(
resolve(
root,
builder.environments.client.config.build.outDir,
'assets',
),
),
fsp.readdir(
resolve(root, builder.environments.ssr.config.build.outDir, 'assets'),
),
fsp.readdir(
resolve(
root,
builder.environments.custom.config.build.outDir,
'assets',
),
),
]),
).toEqual([
expect.arrayContaining([expect.stringMatching(/\.css$/)]),
expect.arrayContaining([expect.stringMatching(/\.css$/)]),
expect.arrayContaining([expect.stringMatching(/\.css$/)]),
])
})

test('adjust worker build error for worker.format', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './test.css'
console.log('entry')
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
color: orange;
}
Loading