mirror of
https://github.com/arnaucube/thoughts.git
synced 2026-02-07 11:46:52 +01:00
get token for user, post users, get all users, post thought, get all thoughts. runs ok
This commit is contained in:
32
node_modules/jsonwebtoken/test/util/fakeDate.js
generated
vendored
Normal file
32
node_modules/jsonwebtoken/test/util/fakeDate.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
var oldDate = global.Date;
|
||||
|
||||
/*
|
||||
* fix new Date() to a fixed unix timestamp.
|
||||
*/
|
||||
global.Date.fix = function (timestamp) {
|
||||
var time = timestamp * 1000;
|
||||
|
||||
if (global.Date.unfake) {
|
||||
global.Date.unfake();
|
||||
}
|
||||
|
||||
global.Date = function (ts) {
|
||||
return new oldDate(ts || time);
|
||||
};
|
||||
|
||||
global.Date.prototype = Object.create(oldDate.prototype);
|
||||
global.Date.prototype.constructor = global.Date;
|
||||
|
||||
global.Date.prototype.now = function () {
|
||||
return time;
|
||||
};
|
||||
|
||||
global.Date.now = function () {
|
||||
return time;
|
||||
};
|
||||
|
||||
global.Date.unfix = function () {
|
||||
global.Date = oldDate;
|
||||
};
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user