Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-06-30 18:40:58 +0300
committerGar <gar+gh@danger.computer>2021-06-30 20:18:03 +0300
commit5f8ccccef9fc19229320df8cbcae9fcea8d31388 (patch)
treeb0c953c20daf0a751b87b4a7aa01c326f7fd0847
parentd2e298f3cbab278071480f94ff7d916d42cbf43b (diff)
chore(tests): clean snapshot for lib/view.js tests
Closes https://github.com/npm/cli/issues/1623 PR-URL: https://github.com/npm/cli/pull/3483 Credit: @wraithgar Close: #3483 Reviewed-by: @isaacs
-rw-r--r--tap-snapshots/test/lib/view.js.test.cjs6
-rw-r--r--test/lib/view.js2
2 files changed, 5 insertions, 3 deletions
diff --git a/tap-snapshots/test/lib/view.js.test.cjs b/tap-snapshots/test/lib/view.js.test.cjs
index 9aafe50e4..41d7a80fe 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 a year ago
+published {TIME} ago
`
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 a year ago
+published {TIME} ago
`
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 a year ago
+published {TIME} ago
`
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 5f2e5a8ad..793917adc 100644
--- a/test/lib/view.js
+++ b/test/lib/view.js
@@ -1,5 +1,7 @@
const t = require('tap')
+t.cleanSnapshot = str => str.replace(/published .*? ago/g, 'published {TIME} ago')
+
// run the same as tap does when running directly with node
process.stdout.columns = undefined