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
path: root/test
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-05-14 17:04:04 +0300
committerisaacs <i@izs.me>2021-05-20 19:51:07 +0300
commit55f2c2ac536c3ebdbbe55048491aca055433f2f3 (patch)
tree83d751add9cf01115623f03a131cc7e5f6096c81 /test
parent0d1a9d78779dc015242fc03d2dad2039004fa2df (diff)
chore(tests): tie usage output to snapshots
We have another PR in flight that will start auto-generating some content in `docs/content/commands`, and will run `postsnap`, which means that if we tie the usage output to a snapshot, the docs will also be updated when the snapshots change. PR-URL: https://github.com/npm/cli/pull/3246 Credit: @wraithgar Close: #3246 Reviewed-by: @isaacs
Diffstat (limited to 'test')
-rw-r--r--test/lib/load-all-commands.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lib/load-all-commands.js b/test/lib/load-all-commands.js
index 935019756..b3b2012d2 100644
--- a/test/lib/load-all-commands.js
+++ b/test/lib/load-all-commands.js
@@ -26,7 +26,10 @@ t.test('load each command', t => {
t.match(impl.usage, cmd, 'usage contains the command')
impl([], (err) => {
t.notOk(err)
- t.match(npmOutput, impl.usage, 'usage is output')
+ t.match(npmOutput, impl.usage, 'usage is what is output')
+ // This ties usage to a snapshot so we have to re-run snap if usage
+ // changes, which rebuilds the man pages
+ t.matchSnapshot(npmOutput)
t.end()
})
})