mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
Coverage for template and publicPath
This commit is contained in:
parent
954c25b420
commit
184bd01b2b
10
test/fixtures/with-config/app.html
vendored
Normal file
10
test/fixtures/with-config/app.html
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html {{ HTML_ATTRS }}>
|
||||||
|
<head>
|
||||||
|
{{ HEAD }}
|
||||||
|
</head>
|
||||||
|
<body {{ BODY_ATTRS }}>
|
||||||
|
{{ APP }}
|
||||||
|
<p>Made by Nuxt.js team</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
test/fixtures/with-config/nuxt.config.js
vendored
6
test/fixtures/with-config/nuxt.config.js
vendored
@ -10,7 +10,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cache: true,
|
cache: true,
|
||||||
plugins: ['~plugins/test.js'],
|
plugins: [
|
||||||
|
'~plugins/test.js',
|
||||||
|
{ src: '~plugins/only-client.js', ssr: false }
|
||||||
|
],
|
||||||
loading: '~components/loading',
|
loading: '~components/loading',
|
||||||
env: {
|
env: {
|
||||||
bool: true,
|
bool: true,
|
||||||
@ -18,6 +21,7 @@ module.exports = {
|
|||||||
string: 'Nuxt.js'
|
string: 'Nuxt.js'
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
publicPath: '/orion/',
|
||||||
analyze: {
|
analyze: {
|
||||||
analyzerMode: 'disabled',
|
analyzerMode: 'disabled',
|
||||||
generateStatsFile: true
|
generateStatsFile: true
|
||||||
|
1
test/fixtures/with-config/plugins/only-client.js
vendored
Normal file
1
test/fixtures/with-config/plugins/only-client.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
console.log('Only called in client-side!')
|
@ -24,6 +24,16 @@ test('/', async t => {
|
|||||||
t.true(html.includes('<h1>I have custom configurations</h1>'))
|
t.true(html.includes('<h1>I have custom configurations</h1>'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('/ (custom app.html)', async t => {
|
||||||
|
const { html } = await nuxt.renderRoute('/')
|
||||||
|
t.true(html.includes('<p>Made by Nuxt.js team</p>'))
|
||||||
|
})
|
||||||
|
|
||||||
|
test('/ (custom build.publicPath)', async t => {
|
||||||
|
const { html } = await nuxt.renderRoute('/')
|
||||||
|
t.true(html.includes('src="/test/orion/vendor.bundle'))
|
||||||
|
})
|
||||||
|
|
||||||
test('/test/ (router base)', async t => {
|
test('/test/ (router base)', async t => {
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/'))
|
const window = await nuxt.renderAndGetWindow(url('/test/'))
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
|
Loading…
Reference in New Issue
Block a user