Comparing version 0.4.3 to 0.4.4
@@ -6,2 +6,13 @@ Changelog | ||
<tr> | ||
<td>0.4.4</td> | ||
<td> | ||
<ul> | ||
<li>Handle ExportNamedDeclaration, thanks to @VictoryStick</li> | ||
<li>Use tmpdir setting in temp store, thanks to @inversion</li> | ||
<li>Set "medium" coverage CSS color scheme to yellow, thanks to @JamesMGreene</li> | ||
<li>use os.tmpdir() instead of os.tmpDir(), thanks to @ChALkeR</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>0.4.3</td> | ||
@@ -8,0 +19,0 @@ <td> |
@@ -101,5 +101,5 @@ /* | ||
extensions.forEach(function(ext){ | ||
if (!(ext in originalLoaders)) { | ||
if (!(ext in originalLoaders)) { | ||
originalLoaders[ext] = Module._extensions[ext] || Module._extensions['.js']; | ||
} | ||
} | ||
Module._extensions[ext] = function (module, filename) { | ||
@@ -106,0 +106,0 @@ var ret = fn(fs.readFileSync(filename, 'utf8'), filename); |
@@ -405,2 +405,3 @@ /* | ||
ExpressionStatement: this.coverStatement, | ||
ExportNamedDeclaration: this.coverExport, | ||
BreakStatement: this.coverStatement, | ||
@@ -804,2 +805,3 @@ ContinueStatement: this.coverStatement, | ||
incrStatementCount, | ||
parent, | ||
grandParent; | ||
@@ -820,6 +822,15 @@ | ||
} | ||
if (node.type === SYNTAX.FunctionDeclaration.name) { | ||
sName = this.statementName(node.loc, 1); | ||
// Called for the side-effect of setting the function's statement count to 1. | ||
this.statementName(node.loc, 1); | ||
} else { | ||
// We let `coverExport` handle ExportNamedDeclarations. | ||
parent = walker.parent(); | ||
if (parent && parent.node.type === SYNTAX.ExportNamedDeclaration.name) { | ||
return; | ||
} | ||
sName = this.statementName(node.loc); | ||
incrStatementCount = astgen.statement( | ||
@@ -833,2 +844,3 @@ astgen.postIncrement( | ||
); | ||
this.splice(incrStatementCount, node, walker); | ||
@@ -838,2 +850,22 @@ } | ||
coverExport: function (node, walker) { | ||
var sName, incrStatementCount; | ||
if ( !node.declaration || !node.declaration.declarations ) { return; } | ||
this.maybeSkipNode(node, 'next'); | ||
sName = this.statementName(node.declaration.loc); | ||
incrStatementCount = astgen.statement( | ||
astgen.postIncrement( | ||
astgen.subscript( | ||
astgen.dot(astgen.variable(this.currentState.trackerVar), astgen.variable('s')), | ||
astgen.stringLiteral(sName) | ||
) | ||
) | ||
); | ||
this.splice(incrStatementCount, node, walker); | ||
}, | ||
splice: function (statements, node, walker) { | ||
@@ -1066,2 +1098,1 @@ var targetNode = walker.isLabeled() ? walker.parent().node : node; | ||
}(typeof module !== 'undefined' && typeof module.exports !== 'undefined' && typeof exports !== 'undefined')); | ||
@@ -14,3 +14,3 @@ /* | ||
function makeTempDir() { | ||
var dir = path.join(os.tmpDir ? os.tmpDir() : /* istanbul ignore next */ (process.env.TMPDIR || '/tmp'), 'ts' + new Date().getTime()); | ||
var dir = path.join(os.tmpdir ? os.tmpdir() : /* istanbul ignore next */ (process.env.TMPDIR || '/tmp'), 'ts' + new Date().getTime()); | ||
mkdirp.sync(dir); | ||
@@ -33,3 +33,3 @@ return dir; | ||
* @param {String} [opts.tmp] a pre-existing directory to use as the `tmp` directory. When not specified, a random directory | ||
* is created under `os.tmpDir()` | ||
* is created under `os.tmpdir()` | ||
* @constructor | ||
@@ -51,3 +51,3 @@ */ | ||
this.seq += 1; | ||
return this.prefix + this.seq + '.tmp'; | ||
return path.join(this.tmp, this.prefix + this.seq + '.tmp'); | ||
}, | ||
@@ -54,0 +54,0 @@ |
{ | ||
"name": "istanbul", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale", | ||
@@ -86,3 +86,7 @@ "keywords": [ | ||
"Abe Fehr @abejfehr <abe.fehr@gmail.com>", | ||
"Brian Woodward @doowb <brian.woodward@gmail.com>" | ||
"Brian Woodward @doowb <brian.woodward@gmail.com>", | ||
"@Victorystick", | ||
"@inversion", | ||
"@JamesMGreene", | ||
"@ChALkeR" | ||
], | ||
@@ -89,0 +93,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6654
293534
55
1
0