code coverage

This commit is contained in:
Pooya Parsa 2017-06-16 17:53:34 +04:30
parent 8f2945111a
commit 0453308e5e
5 changed files with 18 additions and 2 deletions

View File

@ -42,6 +42,11 @@
"bin": {
"nuxt": "./bin/nuxt"
},
"nyc": {
"exclude": [
"/index.js"
]
},
"scripts": {
"test": "npm run lint && nyc ava --verbose --serial test/",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",

View File

@ -292,7 +292,10 @@ export default class Builder extends Tapable {
return parallel(this.compiler.compilers, compiler => new Promise((resolve, reject) => {
let _resolved = false
const handler = (err, stats) => {
if (_resolved) return
/* istanbul ignore if */
if (_resolved) {
return
}
_resolved = true
if (err) {
return reject(err)

View File

@ -235,6 +235,7 @@ export default class Renderer extends Tapable {
res.end(html, 'utf8')
return html
} catch (err) {
/* istanbul ignore if */
if (context.redirected) {
console.error(err) // eslint-disable-line no-console
return err
@ -306,6 +307,7 @@ export default class Renderer extends Tapable {
try {
jsdom = require('jsdom')
} catch (e) {
// istanbul ignore next
console.error('Fail when calling nuxt.renderAndGetWindow(url)') // eslint-disable-line no-console
console.error('jsdom module is not installed') // eslint-disable-line no-console
console.error('Please install jsdom with: npm install --save-dev jsdom') // eslint-disable-line no-console

View File

@ -1,4 +1,7 @@
module.exports = function middlewareModule (options) {
// Empty module
}
module.exports.meta = {
name: 'Empty Module!'
}

View File

@ -39,6 +39,9 @@ module.exports = {
{ src: '~/assets/app.css' }
],
render: {
http2: {
push: true
},
static: {
maxAge: '1y'
}