diff options
author | Gar <gar+gh@danger.computer> | 2021-06-30 18:40:58 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-06-30 20:18:03 +0300 |
commit | 5f8ccccef9fc19229320df8cbcae9fcea8d31388 (patch) | |
tree | b0c953c20daf0a751b87b4a7aa01c326f7fd0847 | |
parent | d2e298f3cbab278071480f94ff7d916d42cbf43b (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.cjs | 6 | ||||
-rw-r--r-- | test/lib/view.js | 2 |
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: [1m[32mlatest[39m[22m: 1.0.0 -published [33ma year ago[39m +published {TIME} ago[39m ` 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: [1m[32mlatest[39m[22m: 1.0.0 -published [33ma year ago[39m +published {TIME} ago[39m ` exports[`test/lib/view.js TAP should log package info package from git > must match snapshot 1`] = ` @@ -302,7 +302,7 @@ dist dist-tags: [1m[32mlatest[39m[22m: 1.0.0 -published [33ma year ago[39m +published {TIME} ago[39m ` 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 |