Skip to content

Commit

Permalink
test(view): Set publish date to yesterday
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Sep 13, 2021
1 parent d57b43d commit 6780680
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tap-snapshots/test/lib/view.js.test.cjs
Expand Up @@ -82,7 +82,7 @@ dist
dist-tags:
latest: 1.0.0
published {TIME} ago[39m
published [33myesterday[39m
`

exports[`test/lib/view.js TAP should log info of package in current working dir specific version > must match snapshot 1`] = `
Expand All @@ -99,7 +99,7 @@ dist
dist-tags:
latest: 1.0.0
published {TIME} ago[39m
published [33myesterday[39m
`

exports[`test/lib/view.js TAP should log package info package from git > must match snapshot 1`] = `
Expand Down Expand Up @@ -302,7 +302,7 @@ dist
dist-tags:
latest: 1.0.0
published {TIME} ago[39m
published [33myesterday[39m
`

exports[`test/lib/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = `
Expand Down
5 changes: 4 additions & 1 deletion test/lib/view.js
Expand Up @@ -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')
Expand All @@ -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': {
Expand Down

0 comments on commit 6780680

Please sign in to comment.