From 6780680f6fd139c329872e38496edd3c0cc1556a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 13 Sep 2021 10:53:13 -0700 Subject: [PATCH] test(view): Set publish date to yesterday Signed-off-by: Anders Kaseorg --- tap-snapshots/test/lib/view.js.test.cjs | 6 +++--- test/lib/view.js | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tap-snapshots/test/lib/view.js.test.cjs b/tap-snapshots/test/lib/view.js.test.cjs index 27ba7b1eb6927..2d5f18d9cf01c 100644 --- a/tap-snapshots/test/lib/view.js.test.cjs +++ b/tap-snapshots/test/lib/view.js.test.cjs @@ -82,7 +82,7 @@ dist dist-tags: latest: 1.0.0 -published {TIME} ago +published yesterday ` exports[`test/lib/view.js TAP should log info of package in current working dir specific version > must match snapshot 1`] = ` @@ -99,7 +99,7 @@ dist dist-tags: latest: 1.0.0 -published {TIME} ago +published yesterday ` exports[`test/lib/view.js TAP should log package info package from git > must match snapshot 1`] = ` @@ -302,7 +302,7 @@ dist dist-tags: latest: 1.0.0 -published {TIME} ago +published yesterday ` exports[`test/lib/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = ` diff --git a/test/lib/view.js b/test/lib/view.js index 793917adc6476..9c263d6237f8f 100644 --- a/test/lib/view.js +++ b/test/lib/view.js @@ -17,6 +17,9 @@ const cleanLogs = () => { console.log = fn } +// 25 hours ago +const yesterday = new Date(Date.now() - 1000 * 60 * 60 * 25) + const packument = (nv, opts) => { if (!opts.fullMetadata) throw new Error('must fetch fullMetadata') @@ -40,7 +43,7 @@ const packument = (nv, opts) => { latest: '1.0.0', }, time: { - '1.0.0': '2019-08-06T16:21:09.842Z', + '1.0.0': yesterday, }, versions: { '1.0.0': {