Skip to content

Commit 509e07c

Browse files
authored
Merge pull request #10 from webfansplz/update-test
Update test case
2 parents 25fd987 + 14fac9e commit 509e07c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/index.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,15 @@ describe('laravel-vite-plugin', () => {
9494
expect(ssrConfig.build.rollupOptions.input).toBe('resources/js/ssr.js')
9595
})
9696

97-
it('prefixes the base with ASSET_URL', () => {
97+
it('prefixes the base with ASSET_URL in production mode', () => {
9898
process.env.ASSET_URL = 'http://example.com'
9999
const plugin = laravel('resources/js/app.js')
100100

101-
const config = plugin.config({}, { command: 'build', mode: 'production' })
102-
expect(config.base).toBe('http://example.com/build/')
101+
const devConfig = plugin.config({}, { command: 'serve', mode: 'development' })
102+
expect(devConfig.base).toBe('')
103+
104+
const prodConfig = plugin.config({}, { command: 'build', mode: 'production' })
105+
expect(prodConfig.base).toBe('http://example.com/build/')
103106

104107
delete process.env.ASSET_URL
105108
})

0 commit comments

Comments
 (0)