mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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,
|
||||
plugins: ['~plugins/test.js'],
|
||||
plugins: [
|
||||
'~plugins/test.js',
|
||||
{ src: '~plugins/only-client.js', ssr: false }
|
||||
],
|
||||
loading: '~components/loading',
|
||||
env: {
|
||||
bool: true,
|
||||
@ -18,6 +21,7 @@ module.exports = {
|
||||
string: 'Nuxt.js'
|
||||
},
|
||||
build: {
|
||||
publicPath: '/orion/',
|
||||
analyze: {
|
||||
analyzerMode: 'disabled',
|
||||
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>'))
|
||||
})
|
||||
|
||||
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 => {
|
||||
const window = await nuxt.renderAndGetWindow(url('/test/'))
|
||||
const html = window.document.body.innerHTML
|
||||
|
Loading…
Reference in New Issue
Block a user