Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "hirestime", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "thin wrapper around process.hrtime", | ||
@@ -25,4 +25,5 @@ "main": "index.js", | ||
"mocha": "~1.15.1", | ||
"chai": "~1.8.1" | ||
"chai": "~1.8.1", | ||
"hrtimemock": "0.0.1" | ||
} | ||
} |
var expect = require('chai').expect; | ||
var hrtimeMock = require('hrtimemock'); | ||
var hirestime = require('../'); | ||
function hrtimeMock(msTime) { | ||
var _hrtime = process.hrtime; | ||
var returnValue = [ | ||
parseInt(msTime / 1e3, 10), | ||
(msTime % 1000) * 1e6 | ||
]; | ||
var isFirst = true; | ||
process.hrtime = function() { | ||
if(isFirst) { | ||
isFirst = false; | ||
return []; | ||
} else { | ||
isFirst = true; | ||
process.hrtime = _hrtime; | ||
return returnValue; | ||
} | ||
} | ||
} | ||
describe('hirestime', function() { | ||
@@ -29,0 +7,0 @@ |
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
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
5288
3
56