Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized cli patterns for jest@beta #7424

Closed
rickhanlonii opened this issue Nov 28, 2018 · 18 comments · Fixed by #7497 · May be fixed by Omrisnyk/npm-lockfiles#206
Closed

Unrecognized cli patterns for jest@beta #7424

rickhanlonii opened this issue Nov 28, 2018 · 18 comments · Fixed by #7497 · May be fixed by Omrisnyk/npm-lockfiles#206
Assignees

Comments

@rickhanlonii
Copy link
Member

🐛 Bug Report

Multiple users are reporting the following error when trying jest@beta:

Unrecognized CLI Parameters:

  Following options were not recognized:
  ["changed-files-with-ancestor", "clear-cache", "clear-mocks", "collect-coverage", "detect-leaks", "detect-open-handles", "error-on-deprecated", "find-related-tests", "force-exit", "last-commit", "list-tests", "log-heap-usage", "map-coverage", "no-stack-trace", "only-changed", "only-failures", "pass-with-no-tests", "reset-mocks", "reset-modules", "restore-mocks", "run-in-band", "run-tests-by-path", "show-config", "skip-filter", "test-location-in-results", "update-snapshot", "use-stderr", "watch-all", "notify-mode", "prettier-path"]

  CLI Options Documentation:
  https://jestjs.io/docs/en/cli.html

To Reproduce

I am unable to repro but the steps seem to be to install and run jest@beta

@onetom @SerhiiBilyk and @bcanseco all reported the same issue in #7382

@rickhanlonii
Copy link
Member Author

Note that I tried to repro and tests passed:

@SimenB
Copy link
Member

SimenB commented Nov 29, 2018

I saw this issue at work, and it was a patch of yargs that did it (12.0.2 -> 12.0.4). Not sure if it's yargs or yargs-parser, though. Didn't dig into it

@SimenB
Copy link
Member

SimenB commented Nov 29, 2018

This diff fixed it for us:

commit a72963e95c5cad2cb8f49ca6cf318d9b92ff0bec
Author: Simen Bekkhus <[email protected]>
Date:   2018-11-19 10:13:31 +0100

    chore: rollback yargs upgrade that broke Jest

diff --git a/yarn.lock b/yarn.lock
index e48ba1fc..a82399a0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7112,7 +7112,7 @@ debug@^3.0.1, debug@^3.1.0, debug@^3.2.5:
   dependencies:
     ms "^2.1.1"
 
-decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0:
+decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
   integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
@@ -20691,14 +20691,6 @@ yargs-parser@^10.1.0:
   dependencies:
     camelcase "^4.1.0"
 
-yargs-parser@^11.1.0:
-  version "11.1.0"
-  resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.0.tgz#0b8104116367bf663089b24e5801438ab50396a3"
-  integrity sha512-lGA5HsbjkpCfekDBHAhgE5OE8xEoqiUDylowr+BvhRCwG1xVYTsd8hx2CYC0NY4k9RIgJeybFTG2EZW4P2aN1w==
-  dependencies:
-    camelcase "^5.0.0"
-    decamelize "^1.2.0"
-
 yargs-parser@^7.0.0:
   version "7.0.0"
   resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
@@ -20706,7 +20698,7 @@ yargs-parser@^7.0.0:
   dependencies:
     camelcase "^4.1.0"
 
-[email protected]:
+[email protected], yargs@^12.0.1, yargs@^12.0.2:
   version "12.0.2"
   resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc"
   integrity sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==
@@ -20724,24 +20716,6 @@ [email protected]:
     y18n "^3.2.1 || ^4.0.0"
     yargs-parser "^10.1.0"
 
-yargs@^12.0.1, yargs@^12.0.2:
-  version "12.0.4"
-  resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.4.tgz#5ea307c6f11f11881c3bc375f9c939194e8cf4bc"
-  integrity sha512-f5esswlPO351AnejaO2A1ZZr0zesz19RehQKwiRDqWtrraWrJy16tsUIKgDXFMVytvNOHPVmTiaTh3wO67I0fQ==
-  dependencies:
-    cliui "^4.0.0"
-    decamelize "^1.2.0"
-    find-up "^3.0.0"
-    get-caller-file "^1.0.1"
-    os-locale "^3.0.0"
-    require-directory "^2.1.1"
-    require-main-filename "^1.0.1"
-    set-blocking "^2.0.0"
-    string-width "^2.0.0"
-    which-module "^2.0.0"
-    y18n "^3.2.1 || ^4.0.0"
-    yargs-parser "^11.1.0"
-
 yargs@^3.10.0:
   version "3.32.0"
   resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"

@rickhanlonii
Copy link
Member Author

Got it, I'll take a deeper look

@SimenB
Copy link
Member

SimenB commented Dec 2, 2018

Maybe fixed by yargs/yargs#1247?

@SimenB
Copy link
Member

SimenB commented Dec 2, 2018

Nope :(

image

@hulkish
Copy link
Contributor

hulkish commented Dec 9, 2018

seeing this too, appears to happen consistently when providing varaduc arguments... for ex: jest --coverageReporters json html

@hulkish
Copy link
Contributor

hulkish commented Dec 9, 2018

@SimenB @rickhanlonii scratch that...found what's causing this - looks like introduced as a breaking change in yargs-parser: https://github.com/yargs/yargs-parser/pull/125/files#diff-168726dbe96b3ce427e7fedce31bb0bcR658

@hulkish
Copy link
Contributor

hulkish commented Dec 9, 2018

I think jest has one of 3 options to fix this:

A: Roll back to [email protected]. Since, the break was introduced in following release.
B: Should jest adopt this change? Aka... support both --foo-bar & --fooBar arg formats?
C: Filter out the --dashed-args before validate? (eww)

@SimenB
Copy link
Member

SimenB commented Dec 10, 2018

We should have B, but the object we get back from yargs should only have the camelCase ones, so we don't have multiple sources of truth

@rickhanlonii
Copy link
Member Author

Great find @hulkish - was that fix released in a patch?

@hulkish
Copy link
Contributor

hulkish commented Dec 11, 2018

@rickhanlonii no, i think jest upgraded to the major version but maybe missed this change

hulkish pushed a commit to hulkish/jest that referenced this issue Dec 11, 2018
@hulkish
Copy link
Contributor

hulkish commented Dec 11, 2018

@SimenB @rickhanlonii ok my attempt at B is up: #7497

@SimenB
Copy link
Member

SimenB commented Dec 11, 2018

was that fix released in a patch?

It was released in a patch version of yargs: 12.0.3 to be exact: https://github.com/yargs/yargs/compare/v12.0.2..v12.0.3#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R32

@rickhanlonii
Copy link
Member Author

That's a bummer, looks like @hulkish put in a fix though, thanks a ton!!

rickhanlonii pushed a commit that referenced this issue Dec 13, 2018
* added dashed arg support to fix #7424

* update docs & changelog

* fix dashed arg support tests

* move changelog item to correct location, small edit to docs

* use camelcase, filter dashed args on returns config
willsmythe pushed a commit to willsmythe/jest that referenced this issue Dec 20, 2018
* added dashed arg support to fix jestjs#7424

* update docs & changelog

* fix dashed arg support tests

* move changelog item to correct location, small edit to docs

* use camelcase, filter dashed args on returns config
aleclarson pushed a commit to aleclarson/jest that referenced this issue Dec 25, 2018
* added dashed arg support to fix jestjs#7424

* update docs & changelog

* fix dashed arg support tests

* move changelog item to correct location, small edit to docs

* use camelcase, filter dashed args on returns config
aleclarson pushed a commit to aleclarson/jest that referenced this issue Dec 25, 2018
* added dashed arg support to fix jestjs#7424

* update docs & changelog

* fix dashed arg support tests

* move changelog item to correct location, small edit to docs

* use camelcase, filter dashed args on returns config
captain-yossarian pushed a commit to captain-yossarian/jest that referenced this issue Jul 18, 2019
* added dashed arg support to fix jestjs#7424

* update docs & changelog

* fix dashed arg support tests

* move changelog item to correct location, small edit to docs

* use camelcase, filter dashed args on returns config
@jaredmahan
Copy link

Any news on this?

@SimenB
Copy link
Member

SimenB commented Jul 19, 2019

It was fixed more than 7 months ago

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants