test/style: use nyc instead of istanbul, npm audit fix

This commit is contained in:
Nils Knappmeier
2019-12-12 23:04:35 +01:00
committed by Nils Knappmeier
parent 3a5b65e02b
commit 1ebce2b53c
7 changed files with 902 additions and 262 deletions
-2
View File
@@ -1,2 +0,0 @@
instrumentation:
excludes: ['**/spec/**', '**/handlebars/compiler/parser.js']
+1 -1
View File
@@ -263,7 +263,7 @@ module.exports = function(grunt) {
this.registerTask('amd', ['babel:amd', 'requirejs']);
this.registerTask('test', ['test:bin', 'test:cov', 'test:check-cov']);
this.registerTask('test', ['test:bin', 'test:cov']);
grunt.registerTask('bench', ['metrics']);
+9
View File
@@ -0,0 +1,9 @@
module.exports = {
'check-coverage': true,
branches: 100,
lines: 100,
functions: 100,
statements: 100,
exclude: ['**/spec/**', '**/handlebars/compiler/parser.js'],
reporter: 'html'
};
+870 -240
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -44,7 +44,7 @@
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-compat": "^3.3.0",
"eslint-plugin-es5": "^1.4.1",
"grunt": "^1.0.3",
"grunt": "^1.0.4",
"grunt-babel": "^5.0.0",
"grunt-bg-shell": "^2.3.3",
"grunt-cli": "^1",
@@ -57,12 +57,12 @@
"grunt-contrib-watch": "^1.1.0",
"grunt-webpack": "^1.0.8",
"husky": "^3.1.0",
"istanbul": "^0.3.0",
"jison": "~0.3.0",
"lint-staged": "^9.5.0",
"mocha": "^5",
"mock-stdin": "^0.3.0",
"mustache": "^2.1.3",
"nyc": "^14.1.1",
"prettier": "^1.19.1",
"semver": "^5.0.1",
"sinon": "^7.5.0",
+17
View File
@@ -710,6 +710,23 @@ describe('builtin helpers', function() {
shouldCompileTo(string, hash, '');
equals(true, called);
});
it('should pass zero log arguments', function() {
var string = '{{log}}';
var hash = { blah: 'whee' };
var called;
console.info = console.log = function() {
expect(arguments.length).to.equal(0);
called = true;
console.log = $log;
};
expectTemplate(string)
.withInput(hash)
.toCompileTo('');
expect(called).to.be.true();
});
/* eslint-enable no-console */
});
+3 -17
View File
@@ -1,5 +1,6 @@
const { execNodeJsScriptWithInheritedOutput } = require('./util/exec-file');
const { createRegisterAsyncTaskFn } = require('./util/async-grunt-task');
const nodeJs = process.argv0;
module.exports = function(grunt) {
const registerAsyncTask = createRegisterAsyncTaskFn(grunt);
@@ -9,10 +10,8 @@ module.exports = function(grunt) {
);
registerAsyncTask('test:cov', async () =>
execNodeJsScriptWithInheritedOutput('node_modules/istanbul/lib/cli.js', [
'cover',
'--source-map',
'--',
execNodeJsScriptWithInheritedOutput('node_modules/nyc/bin/nyc', [
nodeJs,
'./spec/env/runner.js'
])
);
@@ -20,17 +19,4 @@ module.exports = function(grunt) {
registerAsyncTask('test:min', async () =>
execNodeJsScriptWithInheritedOutput('./spec/env/runner', ['--min'])
);
registerAsyncTask('test:check-cov', async () =>
execNodeJsScriptWithInheritedOutput('node_modules/istanbul/lib/cli.js', [
'check-coverage',
'--statements',
'100',
'--functions',
'100',
'--branches',
'100',
'--lines 100'
])
);
};