mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
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 normalize = string => string.replace(reqSep, sysSep)
|
||||
const wp = function (p) {
|
||||
/* istanbul ignore if */
|
||||
if (/^win/.test(process.platform)) {
|
||||
p = p.replace(/\\/g, '\\\\')
|
||||
}
|
||||
|
@ -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",
|
||||
|
36
test/fixtures/with-config/components/loading.vue
vendored
Normal file
36
test/fixtures/with-config/components/loading.vue
vendored
Normal 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>
|
5
test/fixtures/with-config/layouts/app.vue
vendored
Normal file
5
test/fixtures/with-config/layouts/app.vue
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<nuxt-container>
|
||||
<nuxt/>
|
||||
</nuxt-container>
|
||||
</template>
|
3
test/fixtures/with-config/layouts/error.vue
vendored
Normal file
3
test/fixtures/with-config/layouts/error.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>Error page</h1>
|
||||
</template>
|
4
test/fixtures/with-config/nuxt.config.js
vendored
4
test/fixtures/with-config/nuxt.config.js
vendored
@ -1,5 +1,7 @@
|
||||
module.exports = {
|
||||
router: {
|
||||
base: '/test/'
|
||||
}
|
||||
},
|
||||
cache: true,
|
||||
loading: '~components/loading'
|
||||
}
|
||||
|
1
test/fixtures/with-config/plugins/test.js
vendored
Normal file
1
test/fixtures/with-config/plugins/test.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
// Custom plugin
|
Loading…
Reference in New Issue
Block a user