-
-
Save paglias/943c6f3c3efbce095c0e6257eac9b4ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var sinon = require('sinon'); | |
mongoose.connect('mongodb://localhost/test'); | |
var kittySchema = new mongoose.Schema({ | |
name: String, | |
}); | |
var Kitten = mongoose.model('Kitten', kittySchema); | |
let newTime = Date.now() + 36000; // May 31st 2016 | |
let fakeClock = sinon.useFakeTimers(newTime); | |
function start () { | |
Kitten.create({name: 'test'}).then(() => { | |
console.log('created'); | |
return Kitten.find().exec(); | |
}); | |
} | |
start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment