mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
update tests
This commit is contained in:
parent
447e85af14
commit
29a7874169
4
test/fixtures/module/modules/basic/index.js
vendored
4
test/fixtures/module/modules/basic/index.js
vendored
@ -23,8 +23,8 @@ module.exports = function basicModule (options, resolve) {
|
||||
})
|
||||
|
||||
// Require same module twice
|
||||
this.requireModule('~/modules/empty/index.js')
|
||||
this.requireModule('~/modules/empty/index.js')
|
||||
this.requireModule('@/modules/empty/index.js')
|
||||
this.requireModule('@/modules/empty/index.js')
|
||||
|
||||
resolve()
|
||||
}
|
||||
|
@ -9,14 +9,14 @@ module.exports = function middlewareModule (options) {
|
||||
}
|
||||
})
|
||||
// Add local middleware js
|
||||
this.addServerMiddleware('~/modules/middleware/log.js')
|
||||
this.addServerMiddleware('@modules/middleware/log.js')
|
||||
// Add plain middleware
|
||||
this.addServerMiddleware((req, res, next) => {
|
||||
res.setHeader('x-nuxt', 'hello')
|
||||
next()
|
||||
})
|
||||
// Add file middleware
|
||||
this.addServerMiddleware('~/modules/middleware/midd1')
|
||||
this.addServerMiddleware('@modules/middleware/midd1')
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
4
test/fixtures/module/nuxt.config.js
vendored
4
test/fixtures/module/nuxt.config.js
vendored
@ -1,9 +1,9 @@
|
||||
module.exports = {
|
||||
loading: true,
|
||||
modules: [
|
||||
'~modules/basic',
|
||||
'~modules/basic', // Use ~ for deprication warning coverage
|
||||
{
|
||||
src: '~/modules/middleware',
|
||||
src: '@/modules/middleware',
|
||||
options: {
|
||||
foo: 'bar'
|
||||
}
|
||||
|
8
test/fixtures/module/router.js
vendored
8
test/fixtures/module/router.js
vendored
@ -8,14 +8,14 @@ export function createRouter () {
|
||||
mode: 'history',
|
||||
routes: [
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: require('~/views/index.vue'),
|
||||
name: "index"
|
||||
name: 'index'
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
path: '/about',
|
||||
component: require('~/views/about.vue'),
|
||||
name: "about"
|
||||
name: 'about'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
11
test/fixtures/with-config/nuxt.config.js
vendored
11
test/fixtures/with-config/nuxt.config.js
vendored
@ -7,18 +7,17 @@ module.exports = {
|
||||
routes.push({
|
||||
name: 'about-bis',
|
||||
path: '/about-bis',
|
||||
component: '~pages/about.vue'
|
||||
component: '@pages/about.vue'
|
||||
})
|
||||
}
|
||||
},
|
||||
transition: 'test',
|
||||
offline: true,
|
||||
plugins: [
|
||||
'~plugins/test.js',
|
||||
{ src: '~plugins/offline.js', ssr: false },
|
||||
{ src: '~plugins/only-client.js', ssr: false }
|
||||
'~plugins/test.js', // Use ~ for deprication warning coverage
|
||||
{ src: '@plugins/only-client.js', ssr: false }
|
||||
],
|
||||
loading: '~components/loading',
|
||||
loading: '@components/loading',
|
||||
env: {
|
||||
bool: true,
|
||||
num: 23,
|
||||
@ -36,7 +35,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
css: [
|
||||
{ src: '~/assets/app.css' }
|
||||
{ src: '@assets/app.css' }
|
||||
],
|
||||
render: {
|
||||
http2: {
|
||||
|
4
test/fixtures/with-config/plugins/offline.js
vendored
4
test/fixtures/with-config/plugins/offline.js
vendored
@ -1,4 +0,0 @@
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
var OfflinePlugin = require('offline-plugin/runtime')
|
||||
OfflinePlugin.install()
|
||||
}
|
Loading…
Reference in New Issue
Block a user