Skip to content

Commit 1ebce2b

Browse files
committedDec 14, 2019
test/style: use nyc instead of istanbul, npm audit fix
1 parent 3a5b65e commit 1ebce2b

7 files changed

+905
-265
lines changed
 

‎.istanbul.yml

-2
This file was deleted.

‎Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ module.exports = function(grunt) {
263263

264264
this.registerTask('amd', ['babel:amd', 'requirejs']);
265265

266-
this.registerTask('test', ['test:bin', 'test:cov', 'test:check-cov']);
266+
this.registerTask('test', ['test:bin', 'test:cov']);
267267

268268
grunt.registerTask('bench', ['metrics']);
269269

‎nyc.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
'check-coverage': true,
3+
branches: 100,
4+
lines: 100,
5+
functions: 100,
6+
statements: 100,
7+
exclude: ['**/spec/**', '**/handlebars/compiler/parser.js'],
8+
reporter: 'html'
9+
};

‎package-lock.json

+873-243
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"eslint-config-prettier": "^6.7.0",
4545
"eslint-plugin-compat": "^3.3.0",
4646
"eslint-plugin-es5": "^1.4.1",
47-
"grunt": "^1.0.3",
47+
"grunt": "^1.0.4",
4848
"grunt-babel": "^5.0.0",
4949
"grunt-bg-shell": "^2.3.3",
5050
"grunt-cli": "^1",
@@ -57,12 +57,12 @@
5757
"grunt-contrib-watch": "^1.1.0",
5858
"grunt-webpack": "^1.0.8",
5959
"husky": "^3.1.0",
60-
"istanbul": "^0.3.0",
6160
"jison": "~0.3.0",
6261
"lint-staged": "^9.5.0",
6362
"mocha": "^5",
6463
"mock-stdin": "^0.3.0",
6564
"mustache": "^2.1.3",
65+
"nyc": "^14.1.1",
6666
"prettier": "^1.19.1",
6767
"semver": "^5.0.1",
6868
"sinon": "^7.5.0",

‎spec/builtins.js

+17
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,23 @@ describe('builtin helpers', function() {
710710
shouldCompileTo(string, hash, '');
711711
equals(true, called);
712712
});
713+
714+
it('should pass zero log arguments', function() {
715+
var string = '{{log}}';
716+
var hash = { blah: 'whee' };
717+
var called;
718+
719+
console.info = console.log = function() {
720+
expect(arguments.length).to.equal(0);
721+
called = true;
722+
console.log = $log;
723+
};
724+
725+
expectTemplate(string)
726+
.withInput(hash)
727+
.toCompileTo('');
728+
expect(called).to.be.true();
729+
});
713730
/* eslint-enable no-console */
714731
});
715732

‎tasks/test-mocha.js

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { execNodeJsScriptWithInheritedOutput } = require('./util/exec-file');
22
const { createRegisterAsyncTaskFn } = require('./util/async-grunt-task');
3+
const nodeJs = process.argv0;
34

45
module.exports = function(grunt) {
56
const registerAsyncTask = createRegisterAsyncTaskFn(grunt);
@@ -9,28 +10,13 @@ module.exports = function(grunt) {
910
);
1011

1112
registerAsyncTask('test:cov', async () =>
12-
execNodeJsScriptWithInheritedOutput('node_modules/istanbul/lib/cli.js', [
13-
'cover',
14-
'--source-map',
15-
'--',
13+
execNodeJsScriptWithInheritedOutput('node_modules/nyc/bin/nyc', [
14+
nodeJs,
1615
'./spec/env/runner.js'
1716
])
1817
);
1918

2019
registerAsyncTask('test:min', async () =>
2120
execNodeJsScriptWithInheritedOutput('./spec/env/runner', ['--min'])
2221
);
23-
24-
registerAsyncTask('test:check-cov', async () =>
25-
execNodeJsScriptWithInheritedOutput('node_modules/istanbul/lib/cli.js', [
26-
'check-coverage',
27-
'--statements',
28-
'100',
29-
'--functions',
30-
'100',
31-
'--branches',
32-
'100',
33-
'--lines 100'
34-
])
35-
);
3622
};

1 commit comments

Comments
 (1)

mharde1771 commented on Jan 12, 2020

@mharde1771

Thank maybe

Please sign in to comment.