mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
Add test for offline-plugin
This commit is contained in:
parent
e69aa7c401
commit
cce71ce8d5
2
test/fixtures/with-config/nuxt.config.js
vendored
2
test/fixtures/with-config/nuxt.config.js
vendored
@ -10,8 +10,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cache: true,
|
cache: true,
|
||||||
|
offline: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
'~plugins/test.js',
|
'~plugins/test.js',
|
||||||
|
{ src: '~plugins/offline.js', ssr: false },
|
||||||
{ src: '~plugins/only-client.js', ssr: false }
|
{ src: '~plugins/only-client.js', ssr: false }
|
||||||
],
|
],
|
||||||
loading: '~components/loading',
|
loading: '~components/loading',
|
||||||
|
4
test/fixtures/with-config/plugins/offline.js
vendored
Normal file
4
test/fixtures/with-config/plugins/offline.js
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
var OfflinePlugin = require('offline-plugin/runtime')
|
||||||
|
OfflinePlugin.install()
|
||||||
|
}
|
@ -82,7 +82,7 @@ test('/test/about-bis (added with extendRoutes)', async t => {
|
|||||||
|
|
||||||
test('Check stats.json generated by build.analyze', t => {
|
test('Check stats.json generated by build.analyze', t => {
|
||||||
const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json'))
|
const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json'))
|
||||||
t.is(stats.assets.length, 23)
|
t.is(stats.assets.length, 26)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
|
Loading…
Reference in New Issue
Block a user