1 | 'use strict';
|
2 |
|
3 | const chai = require('chai'),
|
4 | expect = chai.expect,
|
5 | SnapshotManager = require('./../lib/core/blob/SnapshotTimeManager');
|
6 |
|
7 | describe('SnapshotTimeManager', () => {
|
8 | it('should return a snapshot date that is at least one second greater than previous snapshot of same container-blob', () => {
|
9 | const timeContext = new Date(),
|
10 | d1 = SnapshotManager.getDate('id1', timeContext),
|
11 | d2 = SnapshotManager.getDate('id1', timeContext),
|
12 | d1Seconds = d1.getSeconds(),
|
13 | d2Seconds = d2.getSeconds();
|
14 | if (d2Seconds === 0) d2Seconds = 60;
|
15 | expect(d2Seconds).to.be.greaterThan(d1Seconds);
|
16 | });
|
17 | }); |
\ | No newline at end of file |