diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-12-10 01:48:05 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-12-11 22:22:35 +0300 |
commit | 244c2069fd093f053d3061c85575ac13e72e2454 (patch) | |
tree | a02a73087f91c260475de49a4f6a2349d0d203e3 /tap-snapshots | |
parent | c3ba1daf7cd335d72aeba80ae0e9f9d215ca9ea5 (diff) |
fix: npm search include/exclude
- Fixes `npm search --searchexclude=<value>` option
- Tweaks `--searchopt` logic
- Refactor and cleanup `lib/search.js`
- Add `test/lib/search.js` tests
- Fixes: https://github.com/npm/statusboard/issues/171
PR-URL: https://github.com/npm/cli/pull/2325
Credit: @ruyadorno
Close: #2325
Reviewed-by: @isaacs
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test-lib-search.js-TAP.test.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tap-snapshots/test-lib-search.js-TAP.test.js b/tap-snapshots/test-lib-search.js-TAP.test.js new file mode 100644 index 000000000..4b4dc75ea --- /dev/null +++ b/tap-snapshots/test-lib-search.js-TAP.test.js @@ -0,0 +1,20 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/search.js TAP empty search results > should have expected search results 1`] = ` +No matches found for "foo" +` + +exports[`test/lib/search.js TAP search <name> --searchexclude --searchopts > should have filtered expected search results 1`] = ` +NAME | AUTHOR | DATE | VERSION | KEYWORDS +foo | =foo | prehistoric | 1.0.0 | +` + +exports[`test/lib/search.js TAP search <name> > should have expected search results 1`] = ` +NAME | AUTHOR | DATE | VERSION | KEYWORDS +libnpm | =nlf… | 2019-07-16 | 3.0.1 | npm api package manager liblibnpmaccess | =nlf… | 2020-11-03 | 4.0.1 | @evocateur/libnpmaccess | =evocateur | 2019-07-16 | 3.1.2 | @evocateur/libnpmpublish | =evocateur | 2019-07-16 | 1.2.2 | libnpmorg | =nlf… | 2020-11-03 | 2.0.1 | libnpm npm package manager api orgs teamslibnpmsearch | =nlf… | 2020-12-08 | 3.1.0 | npm search api libnpmlibnpmteam | =nlf… | 2020-11-03 | 2.0.2 | libnpmhook | =nlf… | 2020-11-03 | 6.0.1 | npm hooks registry npm apilibnpmpublish | =nlf… | 2020-11-03 | 4.0.0 | libnpmfund | =nlf… | 2020-12-08 | 1.0.2 | npm npmcli libnpm cli git fund gitfund@npmcli/map-workspaces | =nlf… | 2020-09-30 | 1.0.1 | npm npmcli libnpm cli workspaces map-workspaceslibnpmversion | =nlf… | 2020-11-04 | 1.0.7 | @types/libnpmsearch | =types | 2019-09-26 | 2.0.1 | +` |