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": {
|
"bin": {
|
||||||
"nuxt": "./bin/nuxt"
|
"nuxt": "./bin/nuxt"
|
||||||
},
|
},
|
||||||
|
"nyc": {
|
||||||
|
"exclude": [
|
||||||
|
"/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && nyc ava --verbose --serial test/",
|
"test": "npm run lint && nyc ava --verbose --serial test/",
|
||||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
"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) => {
|
return parallel(this.compiler.compilers, compiler => new Promise((resolve, reject) => {
|
||||||
let _resolved = false
|
let _resolved = false
|
||||||
const handler = (err, stats) => {
|
const handler = (err, stats) => {
|
||||||
if (_resolved) return
|
/* istanbul ignore if */
|
||||||
|
if (_resolved) {
|
||||||
|
return
|
||||||
|
}
|
||||||
_resolved = true
|
_resolved = true
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err)
|
return reject(err)
|
||||||
|
@ -235,6 +235,7 @@ export default class Renderer extends Tapable {
|
|||||||
res.end(html, 'utf8')
|
res.end(html, 'utf8')
|
||||||
return html
|
return html
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
/* istanbul ignore if */
|
||||||
if (context.redirected) {
|
if (context.redirected) {
|
||||||
console.error(err) // eslint-disable-line no-console
|
console.error(err) // eslint-disable-line no-console
|
||||||
return err
|
return err
|
||||||
@ -306,6 +307,7 @@ export default class Renderer extends Tapable {
|
|||||||
try {
|
try {
|
||||||
jsdom = require('jsdom')
|
jsdom = require('jsdom')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// istanbul ignore next
|
||||||
console.error('Fail when calling nuxt.renderAndGetWindow(url)') // eslint-disable-line no-console
|
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('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
|
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) {
|
module.exports = function middlewareModule (options) {
|
||||||
// Empty module
|
// 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' }
|
{ src: '~/assets/app.css' }
|
||||||
],
|
],
|
||||||
render: {
|
render: {
|
||||||
|
http2: {
|
||||||
|
push: true
|
||||||
|
},
|
||||||
static: {
|
static: {
|
||||||
maxAge: '1y'
|
maxAge: '1y'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user