mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
code coverage
This commit is contained in:
parent
8f2945111a
commit
0453308e5e
@ -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",
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
5
test/fixtures/module/modules/empty/index.js
vendored
5
test/fixtures/module/modules/empty/index.js
vendored
@ -1,4 +1,7 @@
|
||||
|
||||
module.exports = function middlewareModule (options) {
|
||||
// Empty module
|
||||
}
|
||||
|
||||
module.exports.meta = {
|
||||
name: 'Empty Module!'
|
||||
}
|
||||
|
3
test/fixtures/with-config/nuxt.config.js
vendored
3
test/fixtures/with-config/nuxt.config.js
vendored
@ -39,6 +39,9 @@ module.exports = {
|
||||
{ src: '~/assets/app.css' }
|
||||
],
|
||||
render: {
|
||||
http2: {
|
||||
push: true
|
||||
},
|
||||
static: {
|
||||
maxAge: '1y'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user