ignore coverage for code branches where error objects are not crerated
parent
8114a2b442
commit
b5e3e7da6e
|
@ -1,5 +1,5 @@
|
|||
{{## def._error:_rule:
|
||||
{{ /* istanbul ignore else */ }}
|
||||
{{ 'istanbul ignore else'; }}
|
||||
{{? it.createErrors !== false }}
|
||||
{
|
||||
keyword: '{{=_rule}}'
|
||||
|
|
|
@ -19,6 +19,7 @@ console.log('\n\nCompiling:');
|
|||
|
||||
var FUNCTION_NAME = /function\s+anonymous\s*\(it[^)]*\)\s*{/;
|
||||
var OUT_EMPTY_STRING = /out\s*\+=\s*'\s*';/g;
|
||||
var ISTANBUL = /\'(istanbul[^']+)\';/g;
|
||||
|
||||
files.forEach(function (f) {
|
||||
var keyword = path.basename(f, '.jst');
|
||||
|
@ -27,7 +28,8 @@ files.forEach(function (f) {
|
|||
var code = doT.compile(template, defs);
|
||||
code = code.toString()
|
||||
.replace(OUT_EMPTY_STRING, '')
|
||||
.replace(FUNCTION_NAME, 'function generate_' + keyword + '(it) {');
|
||||
.replace(FUNCTION_NAME, 'function generate_' + keyword + '(it) {')
|
||||
.replace(ISTANBUL, '/* $1 */');
|
||||
code = "'use strict';\nmodule.exports = " + code;
|
||||
code = beautify(code, { indent_size: 2 }) + '\n';
|
||||
fs.writeFileSync(targetPath, code);
|
||||
|
|
Loading…
Reference in New Issue