Skip to content

Commit

Permalink
test: fake timers with sinon
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi committed Mar 2, 2020
1 parent 52393a3 commit 689add6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
behavior of `onAuthStateChanged()` (see below)
- Support for Firebase Messaging (Admin API)
- Support for [FieldValue.increment](https://firebase.google.com/docs/reference/js/firebase.firestore.FieldValue#increment)
- Support for [firestore.Timestamp.now()](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now)

### Changed
- (Breaking) Consistent with Firebase SDK [version 4.0.0](https://firebase.google.com/support/release-notes/js#version_500_-_may_8_2018) and later,
Expand Down
8 changes: 8 additions & 0 deletions test/unit/timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ var sinon = require('sinon');
var Timestamp = require('../../src/timestamp');

describe('Timestamp', function () {
var clock;
beforeEach(function () {
clock = sinon.useFakeTimers();
});
afterEach(function () {
clock.restore();
});

describe('fromDate', function () {
it('should convert from date', function () {
var date = new Date('2009-02-13T23:31:30.123456789Z');
Expand Down

0 comments on commit 689add6

Please sign in to comment.