update tests

This commit is contained in:
Pooya Parsa 2017-06-29 21:30:18 +04:30
parent 447e85af14
commit 29a7874169
8 changed files with 28 additions and 33 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -23,8 +23,8 @@ module.exports = function basicModule (options, resolve) {
}) })
// Require same module twice // 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() resolve()
} }

View File

@ -9,14 +9,14 @@ module.exports = function middlewareModule (options) {
} }
}) })
// Add local middleware js // Add local middleware js
this.addServerMiddleware('~/modules/middleware/log.js') this.addServerMiddleware('@modules/middleware/log.js')
// Add plain middleware // Add plain middleware
this.addServerMiddleware((req, res, next) => { this.addServerMiddleware((req, res, next) => {
res.setHeader('x-nuxt', 'hello') res.setHeader('x-nuxt', 'hello')
next() next()
}) })
// Add file middleware // Add file middleware
this.addServerMiddleware('~/modules/middleware/midd1') this.addServerMiddleware('@modules/middleware/midd1')
resolve() resolve()
}) })
} }

View File

@ -1,11 +1,11 @@
const path = require('path') const path = require('path')
module.exports = function () { module.exports = function () {
// Disable parsing pages/ // Disable parsing pages/
this.nuxt.options.build.createRoutes = () => {} this.nuxt.options.build.createRoutes = () => {}
// Add /api endpoint // Add /api endpoint
this.addTemplate({ this.addTemplate({
fileName: 'router.js', fileName: 'router.js',
src: path.resolve(this.options.srcDir, 'router.js') src: path.resolve(this.options.srcDir, 'router.js')
}) })
} }

View File

@ -1,9 +1,9 @@
module.exports = { module.exports = {
loading: true, loading: true,
modules: [ modules: [
'~modules/basic', '~modules/basic', // Use ~ for deprication warning coverage
{ {
src: '~/modules/middleware', src: '@/modules/middleware',
options: { options: {
foo: 'bar' foo: 'bar'
} }

View File

@ -7,16 +7,16 @@ export function createRouter () {
return new Router({ return new Router({
mode: 'history', mode: 'history',
routes: [ routes: [
{ {
path: "/", path: '/',
component: require('~/views/index.vue'), component: require('~/views/index.vue'),
name: "index" name: 'index'
}, },
{ {
path: "/about", path: '/about',
component: require('~/views/about.vue'), component: require('~/views/about.vue'),
name: "about" name: 'about'
} }
] ]
}) })
} }

View File

@ -7,18 +7,17 @@ module.exports = {
routes.push({ routes.push({
name: 'about-bis', name: 'about-bis',
path: '/about-bis', path: '/about-bis',
component: '~pages/about.vue' component: '@pages/about.vue'
}) })
} }
}, },
transition: 'test', transition: 'test',
offline: true, offline: true,
plugins: [ plugins: [
'~plugins/test.js', '~plugins/test.js', // Use ~ for deprication warning coverage
{ 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',
env: { env: {
bool: true, bool: true,
num: 23, num: 23,
@ -36,7 +35,7 @@ module.exports = {
} }
}, },
css: [ css: [
{ src: '~/assets/app.css' } { src: '@assets/app.css' }
], ],
render: { render: {
http2: { http2: {

View File

@ -1,4 +0,0 @@
if (process.env.NODE_ENV === 'production') {
var OfflinePlugin = require('offline-plugin/runtime')
OfflinePlugin.install()
}