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
AgeCommit message (Collapse)Author
2021-03-18Remove old config definitions and flattening logicisaacs/config-refactorisaacs
PR-URL: https://github.com/npm/cli/pull/2878 Credit: @isaacs Close: #2878 Reviewed-by: @isaacs
2021-03-18update lib/*.js to use new config structuresisaacs
2021-03-18New consolidated config definitionsisaacs
This replaces the multiple separate sets of objects and documentation, some of which had defaults and/or types, some of which didn't, and cleans up a lot of configs that are no longer used. Deprecated configs are now marked, and the approach used to create these config definitions ensures that it is impossible to create a new config option that lacks the appropriate data for it.
2021-03-18fix(publish): handle case where multiple config list is presentKenrick
When not handled, when there are multiple entries in this.npm.config.list, it causes crash as described in #2834 The change here merge everything in this.npm.config.list, because as I observed, the default config is present only at the last entry. Fix: #2834 Co-authored-by: @wraithgar PR-URL: https://github.com/npm/cli/pull/2865 Credit: @kenrick95 Close: #2865 Reviewed-by: @isaacs, @wraithgar
2021-03-18chore(config): remove flatOptions referencesGar
Iterative change moving us towards a more unified config. No longer pulling config from flatOptions where we don't have to. PR-URL: https://github.com/npm/cli/pull/2892 Credit: @wraithgar Close: #2892 Reviewed-by: @ruyadorno
2021-03-09Fix cb() never called in search with --json optionFraqe
PR-URL: https://github.com/npm/cli/pull/2831 Credit: @fraqe Close: #2831 Reviewed-by: @isaacs
2021-03-09fix(usage): clean up usage declarationsGar
Small refactor of commands to allow usage to be more programmatically generated, leading us in the direction of more tighly coupling each command to the params it accepts. PR-URL: https://github.com/npm/cli/pull/2821 Credit: @wraithgar Close: #2821 Reviewed-by: @isaacs
2021-03-09fix(npm.output): make output go through npm.outputGar
All output that anything wants to make now goes through `npm.output()`. This is an incremental change getting us closer to where we want to be with testing. PR-URL: https://github.com/npm/cli/pull/2795 Credit: @wraithgar Close: #2795 Reviewed-by: @ruyadorno, @isaacs
2021-03-05fix(repo, auth.sso): don't promisify open-urlGar
This causes a `cb() not called` error as the promisified function explodes silently. PR-URL: https://github.com/npm/cli/pull/2824 Credit: @wraithgar Close: #2824 Reviewed-by: @ruyadorno
2021-03-05fix(diff): set option where for pacoteRuy Adorno
pacote expects a **where** option that sets the cwd for all its operations, ref: https://github.com/npm/pacote#options This change properly sets that option in libnpmdiff options that will then properly forward it to pacote, this is specially important for when reading local file system specs. PR-URL: https://github.com/npm/cli/pull/2822 Credit: @ruyadorno Close: #2822 Reviewed-by: @wraithgar
2021-03-05feat/explain: show when an edge is a bundled edgekumavis
PR-URL: https://github.com/npm/cli/pull/2807 Credit: @kumavis Close: #2807 Reviewed-by: @ruyadorno
2021-03-05Get correct npm prefix on all Windows unix shellsisaacs/fix-windows-shell-binsisaacs
1. Set the shebang to /usr/bin/env bash instead of /bin/sh (which might be dash or some other shell) 2. Use Unix-style line endings, not Windows-style (Cygwin accepts either, but mingw bash sometimes objects, and WSL bash always does) 3. Test against paths using wslpath if available, but still pass win32 paths to node.exe, since it is a Windows binary that only knows how to handle Windows paths. This makes npm as installed by the Node.js Windows MSI installer behave properly under WSL, Cygwin, MINGW Git Bash, and the internal MINGW Git Bash when posix CLI utilities are exposed to the cmd.exe shell. The test is not quite as comprehensive as I'd like. It runs on the various Windows bash implementations if they are found in their expected locations, skipping any that are not installed. Short of shipping mingw, cygwin, and wsl as test fixtures, I'm not sure how we could do much better, however. At least, we can use this test to assist debug and catch issues on Windows machines (ours or users who report problems). PR-URL: https://github.com/npm/cli/pull/2789 Credit: @isaacs Close: #2789 Reviewed-by: @nlf
2021-03-05fix(npm) pass npm context everywhereGar
Instead of files randomly requiring the npm singleton, we pass it where it needs to go so that tests don't need to do so much require mocking everywhere PR-URL: https://github.com/npm/cli/pull/2772 Credit: @wraithgar Close: #2772 Reviewed-by: @ruyadorno
2021-02-25fix(test): update hidden package-lock mtime in lsisaacs
That file must be newer than the others for the code to do what we are expecting PR-URL: https://github.com/npm/cli/pull/2782 Credit: @isaacs Close: #2782 Reviewed-by: @wraithgar
2021-02-25chore(refactor): promisify completion scriptsGar
We also removed the "none" script because we handle a missing script just fine. There is no need to put an empty one in PR-URL: https://github.com/npm/cli/pull/2759 Credit: @wraithgar Close: #2759 Reviewed-by: @nlf
2021-02-25feat(explain): mark when dependency is bundledkumavis
When using `npm explain <package>` it's useful to see if the package has been bundled. This is especially useful when trying to understand the provenance of a package's content PR-URL: https://github.com/npm/cli/pull/2750 Credit: @kumavis Close: #2750 Reviewed-by: @nlf
2021-02-22update tests for new @npmcli/arborist behaviorisaacs
2021-02-22Move implementation to separate packageisaacs/hide-easter-egg-betterisaacs
PR-URL: https://github.com/npm/cli/pull/2743 Credit: @isaacs Close: #2743 Reviewed-by: @nlf
2021-02-22chore(refactor): clean up lifecycle-cmdsGar
This is a small incremental step in removing some of the complexity surrounding the `npm` object in our code. It moves that object one level up the chain of code, with the end goal being that we will only require it once in the codebase, ultimately allowing us to improve our tests. I also changed the command that it calls to `run-script` because that is the base command. `run` was an alias, and that is one more layer of hoops a developer would have to jump through to find what file in `./lib` is even being referenced here. PR-URL: https://github.com/npm/cli/pull/2753 Credit: @wraithgar Close: #2753 Reviewed-by: @isaacs
2021-02-22Do not print error banner for shell proxy commandsisaacs
There are a few commands (exec, run-script, and the run-script proxies) where essentially npm is acting like a very fancy shell. It is peculiar and noisy for npm to print a verbose error banner at the end of these commands, since presumably the command itself already did whatever it had to do to report the error appropriately. For example, `npm test` runs a test script, usually outputting test results. Having npm then tell me that my tests failed with exit status 1 and print a debug log, is unnecessary and unwanted. When the error encountered for these commands does not have a non-zero numeric 'code', then we still print the standard npm error reporting messages, because presumably something went wrong OTHER than a process exiting with a non-zero status code. PR-URL: https://github.com/npm/cli/pull/2742 Credit: @isaacs Close: #2742 Reviewed-by: @nlf
2021-02-22test: fix typo in shrinkwrap.jsIkko Ashimine
contructor -> constructor PR-URL: https://github.com/npm/cli/pull/2729 Credit: @eltociear Close: #2729 Reviewed-by: @wraithgar
2021-02-19chore(tests): refactor publish testsGar
Less mocking, more intentional testing of things PR-URL: https://github.com/npm/cli/pull/2717 Credit: @wraithgar Close: #2717 Reviewed-by: @nlf
2021-02-18throw an error when trying to dedupe in global modenlf/no-global-dedupenlf
PR-URL: https://github.com/npm/cli/pull/2716 Credit: @nlf Close: #2716 Reviewed-by: @ljharb, @wraithgar
2021-02-18restore the prefix on output from `npm version <inc>`nlf/restore-tag-prefix-on-versionnlf
PR-URL: https://github.com/npm/cli/pull/2718 Credit: @nlf Close: #2718 Reviewed-by: @wraithgar
2021-02-12[fix] node v10.0 lacks `fs.promises`Jordan Harband
In this node version, fall back to `util.promisify` of the callback version. Maybe fixes https://github.com/npm/cli/issues/2623. Maybe fixes https://github.com/npm/cli/issues/2652. Maybe fixes https://github.com/npm/cli/issues/2625. PR-URL: https://github.com/npm/cli/pull/2654 Credit: @ljharb Close: #2654 Reviewed-by: @wraithgar, @ruyadorno
2021-02-12fix(tests): rewrite doctor testsJordan Harband
This decouples our tests from depending on the node version being right, and allows us to run in all of the environments we need to during CI. PR-URL: https://github.com/npm/cli/pull/2681 Credit: @ljharb Close: #2681 Reviewed-by: @wraithgar
2021-02-11fix(env): Do not clobber defined 'env' scriptisaacs
If an env script is already defined, run that instead of the default. PR-URL: https://github.com/npm/cli/pull/2655 Credit: @isaacs Close: #2655 Reviewed-by: @ljharb
2021-02-05fix(publish): follow configs for registry authGar
The "do you have auth configured" only takes into consideration a hard-coded "registry" config, which means that if you don't have auth configured for the npm registry, but you do for the one you have tied to a scope elsewhere in your npmrc, we would erroneously tell you that to add a token. This uses the same method that the rest of the publish chain uses to determine which registry it would be publishing to, then sees if you have auth for THAT registry. Because that other function does a hard fallback to the npm registry, there is no more need for the exception we throw if you do not have one configured. Also, the npm cli already defaults that config item, so you can't even set it to a falsey value if you wanted
2021-02-05chore: utils cleanup and testsnlf
- remove spawn util, refactor help command - add tests for read-user-info, minor refactor - add tests for pulse-till-done util, refactor - add tests for otplease util - add tests for open-url util - remove unused no-progress-while-running util PR-URL: https://github.com/npm/cli/pull/2601 Credit: @nlf Close: #2601 Reviewed-by: @ruyadorno, @wraithgar
2021-02-01test: do not depend on npm.version in usage testisaacs
2021-02-01Add test for ansi-trim moduleisaacs
2021-02-01test: Add test for npm-usage.js, and fix 'npm --long' outputisaacs
2021-02-01wrap a timer around the rimraf call in npm-ciisaacs/ci-rm-timerisaacs
Fix: https://github.com/npm/arborist/issues/207 PR-URL: https://github.com/npm/cli/pull/2573 Credit: @isaacs Close: #2573 Reviewed-by: @nlf
2021-01-28feat: add npm diffruyadorno/npm-diffRuy Adorno
- As proposed in RFC: https://github.com/npm/rfcs/pull/144 PR-URL: https://github.com/npm/cli/pull/1319 Credit: @ruyadorno Close: #1319 Reviewed-by: @isaacs
2021-01-28fix: publish: test defaultTag caused early errordr-js
PR-URL: https://github.com/npm/cli/pull/2445 Credit: @dr-js Close: #2445 Reviewed-by: @ruyadorno
2021-01-28test: publish: test add read registry only from publishConfigdr-js
2021-01-15test: fix test/lib/outdated.js coverageRuy Adorno
Adds a optionalDependencies to fixtures in order to cover missing LOC
2021-01-15fix: npm ls global testsRuy Adorno
2021-01-15fix(link): already linked packages w/ global prefixnlf
correctly identify already linked packages when global prefix is a symlink PR-URL: https://github.com/npm/cli/pull/2486 Credit: @nlf Close: #2486 Reviewed-by: @wraithgar
2021-01-07lint fixisaacs
2021-01-07fix(ci): pay attention to --ignore-scriptsMichael Garvin
Added a test for install too for this specific condition PR-URL: https://github.com/npm/cli/pull/2455 Credit: @wraithgar Close: #2455 Reviewed-by: @isaacs
2021-01-07pass extra arguments directly to run-script as an arraynlf/fix-script-argsnlf
fixes #2425 PR-URL: https://github.com/npm/cli/pull/2448 Credit: @nlf Close: #2448 Reviewed-by: @isaacs, @wraithgar, @darcyclarke
2021-01-07fix: npm publish --dry-run should not check login statusfuhao.xu
PR-URL: https://github.com/npm/cli/pull/2422 Credit: @buyan302 Close: #2422 Reviewed-by: @isaacs
2021-01-07test: add code coverage to missing branchisaacs
2021-01-07Remove process.umask() call from config defaultisaacs/remove-process-umaskisaacs
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103 PR-URL: https://github.com/npm/cli/pull/2444 Credit: @isaacs Close: #2444 Reviewed-by: @nlf
2020-12-18remove the metrics sendernlf/remove-metricsnlf
PR-URL: https://github.com/npm/cli/pull/2382 Credit: @nlf Close: #2382 Reviewed-by: @isaacs
2020-12-18(docs,test): assorted typo fixesXhmikosR
PR-URL: https://github.com/npm/cli/pull/2381 Credit: @XhmikosR Close: #2381 Reviewed-by: @isaacs
2020-12-18fix: npm profile refactorRuy Adorno
- Fixes using `--otp` config option in `npm profile enable-2fa` - Prevents trying to enable 2fa if no user is logged in - Setting email should not require password - Add `test/lib/profile.js` tests - Async/await `lib/profile.js` refactor and more - Fixes: https://github.com/npm/statusboard/issues/164 PR-URL: https://github.com/npm/cli/pull/2373 Credit: @ruyadorno Close: #2373 Reviewed-by: @isaacs
2020-12-18Include prerelease versions when deprecatingTieg Zaharia
PR-URL: https://github.com/npm/cli/pull/2366 Credit: @tiegz Close: #2366 Reviewed-by: @isaacs EDIT(@isaacs): updated to make _all_ deprecation ranges include prereleases. If `foo@*` would be expected to deprecate `foo@1.0.0-beta`, then presumably `foo@1.x` has the same expectation.
2020-12-18Support multiple set/get/deletes in npm configisaacs/config-set-multiisaacs
While digging into #2300, I realized it would be a lot easier if we could do this: npm config set email=me@example.com _auth=xxxx and avoid the whole issue of what gets set first. Also, why not let `npm config get foo bar baz` return just the keys specified? Also updates the docs, including the statement that `npm config set foo` with no value sets it to `true`, when as far as I can tell, that has never been the case. PR-URL: https://github.com/npm/cli/pull/2362 Credit: @isaacs Close: #2362 Reviewed-by: @nlf