Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timekeeper

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timekeeper - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

5

History.md
0.0.4 / 2013-11-22
==================
* Add an isKeepingTime() function for reflection
0.0.3 / 2012-08-08

@@ -3,0 +8,0 @@ ==================

@@ -162,2 +162,11 @@ /**

/**
* Reflection: Are we currently modifying the native Date object?
*
* @api public
*/
timekeeper.isKeepingTime = function() {
return Date === FakeDate;
};
/**
* Replace the `Date` with `FakeDate`.

@@ -164,0 +173,0 @@ */

7

package.json
{
"name": "timekeeper"
, "description": "Easy testing of time-dependent code."
, "version": "0.0.3"
, "description": "Easy testing of time-dependent code."
, "version": "0.0.4"
, "keywords": ["fake date", "date test", "mocking date"]

@@ -24,5 +24,2 @@ , "author": "Veselin Todorov <hi@vesln.com>"

, "main": "./lib/timekeeper.js"
, "engines": {
"node": "x.x.x"
}
}

@@ -22,3 +22,3 @@ [![Build Status](https://secure.travis-ci.org/vesln/timekeeper.png)](http://travis-ci.org/vesln/timekeeper)

var tk = require('timekeeper');
var time = new Date(1330688329321);
var time = new Date(1330688329321);

@@ -36,3 +36,3 @@ tk.freeze(time);

### Travel:
### Travel:

@@ -57,5 +57,17 @@ ```js

### Reflection:
```js
var tk = require('timekeeper');
var time = new Date(1893448800000); // January 1, 2030 00:00:00
assertFalse(tk.isKeepingTime());
tk.travel(time);
assertTrue(tk.isKeepingTime());
```
## Requirements
- NPM (http://npmjs.org/)
- npm (http://npmjs.org/)
- Node.js (http://nodejs.org/)

@@ -62,0 +74,0 @@

@@ -92,2 +92,12 @@ /**

});
describe('reflection', function() {
it('should know if time is being modified', function() {
tk.isKeepingTime().should.be.eql(false);
tk.freeze(new Date(1330688329321));
tk.isKeepingTime().should.be.eql(true);
tk.reset();
tk.isKeepingTime().should.be.eql(false);
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc