| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 20 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { assert } from 'chai'; |
||
| 2 | import entry from '../entry'; |
||
| 3 | |||
| 4 | suite('Generators: date'); |
||
| 5 | |||
| 6 | test('no params', function () { |
||
| 7 | const date = entry.date(); |
||
| 8 | |||
| 9 | assert.isAbove(date, new Date(Date.now() - 366 * 24 * 60 * 60 * 1000)); |
||
| 10 | assert.isBelow(date, new Date()); |
||
| 11 | }); |
||
| 12 | |||
| 13 | test('next week', function () { |
||
| 14 | const min = new Date(); |
||
| 15 | const max = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000); |
||
| 16 | const date = entry.date(min, max); |
||
| 17 | |||
| 18 | assert.isAbove(date, min); |
||
| 19 | assert.isBelow(date, max); |
||
| 20 | }); |
||
| 21 |