restore date range test, remove problematic test cases

This commit is contained in:
DIYgod
2019-01-09 19:04:37 +08:00
parent 6643233063
commit 38a089a436
3 changed files with 6 additions and 7 deletions

View File

@@ -4,9 +4,9 @@ const parser = new Parser();
function checkDate(date) {
expect(date).toEqual(expect.any(String));
expect(Date.parse(date)).toEqual(expect.any(Number));
// expect(new Date() - new Date(date)).toBeGreaterThan(0);
expect(new Date() - new Date(date)).toBeGreaterThan(-1000 * 60 * 60 * 24 * 5);
// date must be in 1 year
// expect(new Date() - new Date(date)).toBeLessThan(1000 * 60 * 60 * 24 * 30 * 12);
expect(new Date() - new Date(date)).toBeLessThan(1000 * 60 * 60 * 24 * 30 * 12 * 5);
}
module.exports = async (response) => {