test/style: use nyc instead of istanbul, npm audit fix
This commit is contained in:
committed by
Nils Knappmeier
parent
3a5b65e02b
commit
1ebce2b53c
@@ -1,2 +0,0 @@
|
||||
instrumentation:
|
||||
excludes: ['**/spec/**', '**/handlebars/compiler/parser.js']
|
||||
+1
-1
@@ -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']);
|
||||
|
||||
|
||||
@@ -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'
|
||||
};
|
||||
Generated
+870
-240
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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",
|
||||
|
||||
@@ -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
@@ -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'
|
||||
])
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user