Skip to content

Commit

Permalink
Merge pull request #10 from webfansplz/update-test
Browse files Browse the repository at this point in the history
Update test case
  • Loading branch information
jessarcher committed Jun 10, 2022
2 parents 25fd987 + 14fac9e commit 509e07c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ describe('laravel-vite-plugin', () => {
expect(ssrConfig.build.rollupOptions.input).toBe('resources/js/ssr.js')
})

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

const config = plugin.config({}, { command: 'build', mode: 'production' })
expect(config.base).toBe('http://example.com/build/')
const devConfig = plugin.config({}, { command: 'serve', mode: 'development' })
expect(devConfig.base).toBe('')

const prodConfig = plugin.config({}, { command: 'build', mode: 'production' })
expect(prodConfig.base).toBe('http://example.com/build/')

delete process.env.ASSET_URL
})
Expand Down

0 comments on commit 509e07c

Please sign in to comment.