Add code coverage by Intanbul

master
Mingun 6 years ago
parent d6142772f8
commit f0e5eebe1a

2
.gitignore vendored

@ -1,3 +1,5 @@
/browser
/examples/*.js
/node_modules
/coverage
/.nyc_output

@ -427,6 +427,7 @@ function generateJS( ast, options ) {
" ip++;",
" break;",
"",
" // istanbul ignore next",
" default:",
" throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");",
" }",
@ -533,6 +534,7 @@ function generateJS( ast, options ) {
elseSp = stack.sp;
ip += elseLength;
// istanbul ignore if
if ( thenSp !== elseSp ) {
throw new Error(
@ -567,6 +569,7 @@ function generateJS( ast, options ) {
bodySp = stack.sp;
ip += bodyLength;
// istanbul ignore if
if ( bodySp !== baseSp ) {
throw new Error( "Body of a loop can't move the stack pointer." );
@ -780,6 +783,7 @@ function generateJS( ast, options ) {
ip++;
break;
// istanbul ignore next
default:
throw new Error( "Invalid opcode: " + bc[ ip ] + "." );
@ -843,6 +847,7 @@ function generateJS( ast, options ) {
" this.location = location;",
" this.name = \"SyntaxError\";",
"",
" // istanbul ignore next",
" if (typeof Error.captureStackTrace === \"function\") {",
" Error.captureStackTrace(this, peg$SyntaxError);",
" }",
@ -1003,6 +1008,7 @@ function generateJS( ast, options ) {
" log(event);",
" break;",
"",
" // istanbul ignore next",
" default:",
" throw new Error(\"Invalid event type: \" + event.type + \".\");",
" }",

@ -17,6 +17,7 @@ function peg$SyntaxError(message, expected, found, location) {
this.location = location;
this.name = "SyntaxError";
// istanbul ignore next
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, peg$SyntaxError);
}

@ -30,7 +30,7 @@
"clean": "gulp clean",
"test:impact": "node test/impact",
"test:server": "node test/server/run",
"test": "gulp"
"test": "nyc gulp"
},
"devDependencies": {
"babel-preset-es2015": "6.24.1",
@ -50,6 +50,7 @@
"gulp-rename": "1.2.2",
"gulp-uglify": "3.0.0",
"morgan": "1.9.0",
"nyc": "11.3.0",
"run-sequence": "2.2.0",
"sinon": "4.1.3",
"vinyl-buffer": "1.0.0",
@ -57,5 +58,16 @@
},
"engines": {
"node": ">=4"
},
"nyc": {
"exclude": [
"test",
"gulpfile.js",
"**/.eslintrc.js"
],
"reporter": [
"text",
"text-summary"
]
}
}

Loading…
Cancel
Save