mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 18:37:21 +00:00
20 lines
720 B
JavaScript
20 lines
720 B
JavaScript
import renderConfig from '../../src/config/render'
|
|
|
|
describe('config: render', () => {
|
|
test('should return false in default shouldPrefetch', () => {
|
|
const { bundleRenderer: { shouldPrefetch } } = renderConfig()
|
|
expect(shouldPrefetch()).toEqual(false)
|
|
})
|
|
|
|
test('should return true in script/style shouldPreload', () => {
|
|
const { bundleRenderer: { shouldPreload } } = renderConfig()
|
|
expect(shouldPreload(undefined, 'script')).toEqual(true)
|
|
expect(shouldPreload(undefined, 'style')).toEqual(true)
|
|
})
|
|
|
|
test('should return false in other shouldPreload', () => {
|
|
const { bundleRenderer: { shouldPreload } } = renderConfig()
|
|
expect(shouldPreload(undefined, 'font')).toEqual(false)
|
|
})
|
|
})
|