More tests for build/index.js

This commit is contained in:
Sébastien Chopin 2016-12-21 19:27:36 +01:00
parent 957e730bc4
commit ba4a7c3e0b
7 changed files with 50 additions and 2 deletions

View File

@ -22,6 +22,7 @@ const reqSep = /\//g
const sysSep = _.escapeRegExp(sep)
const normalize = string => string.replace(reqSep, sysSep)
const wp = function (p) {
/* istanbul ignore if */
if (/^win/.test(process.platform)) {
p = p.replace(/\\/g, '\\\\')
}

View File

@ -35,7 +35,7 @@
"nuxt": "./bin/nuxt"
},
"scripts": {
"test": "nyc ava --serial test/",
"test": "nyc ava test/",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint --ext .js,.vue bin lib pages test/*.js --ignore-pattern lib/app",
"build": "webpack",

View File

@ -0,0 +1,36 @@
<template lang="html">
<div class="loading-page" v-if="loading">
<p>Loading...</p>
</div>
</template>
<script>
export default {
data: () => ({
loading: false
}),
methods: {
start () {
this.loading = true
},
finish () {
this.loading = false
}
}
}
</script>
<style scoped>
.loading-page {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.8);
text-align: center;
padding-top: 200px;
font-size: 30px;
font-family: sans-serif;
}
</style>

View File

@ -0,0 +1,5 @@
<template>
<nuxt-container>
<nuxt/>
</nuxt-container>
</template>

View File

@ -0,0 +1,3 @@
<template>
<h1>Error page</h1>
</template>

View File

@ -1,5 +1,7 @@
module.exports = {
router: {
base: '/test/'
}
},
cache: true,
loading: '~components/loading'
}

View File

@ -0,0 +1 @@
// Custom plugin