mirror of https://github.com/nuxt/nuxt.git
More tests for build/index.js
This commit is contained in:
parent
957e730bc4
commit
ba4a7c3e0b
|
@ -22,6 +22,7 @@ const reqSep = /\//g
|
||||||
const sysSep = _.escapeRegExp(sep)
|
const sysSep = _.escapeRegExp(sep)
|
||||||
const normalize = string => string.replace(reqSep, sysSep)
|
const normalize = string => string.replace(reqSep, sysSep)
|
||||||
const wp = function (p) {
|
const wp = function (p) {
|
||||||
|
/* istanbul ignore if */
|
||||||
if (/^win/.test(process.platform)) {
|
if (/^win/.test(process.platform)) {
|
||||||
p = p.replace(/\\/g, '\\\\')
|
p = p.replace(/\\/g, '\\\\')
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
"nuxt": "./bin/nuxt"
|
"nuxt": "./bin/nuxt"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "nyc ava --serial test/",
|
"test": "nyc ava test/",
|
||||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||||
"lint": "eslint --ext .js,.vue bin lib pages test/*.js --ignore-pattern lib/app",
|
"lint": "eslint --ext .js,.vue bin lib pages test/*.js --ignore-pattern lib/app",
|
||||||
"build": "webpack",
|
"build": "webpack",
|
||||||
|
|
|
@ -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>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<template>
|
||||||
|
<nuxt-container>
|
||||||
|
<nuxt/>
|
||||||
|
</nuxt-container>
|
||||||
|
</template>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<template>
|
||||||
|
<h1>Error page</h1>
|
||||||
|
</template>
|
|
@ -1,5 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
router: {
|
router: {
|
||||||
base: '/test/'
|
base: '/test/'
|
||||||
}
|
},
|
||||||
|
cache: true,
|
||||||
|
loading: '~components/loading'
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
// Custom plugin
|
Loading…
Reference in New Issue