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

notifyMode is ignored when used at jest.config.js #8826

Closed
felipepastorelima opened this issue Aug 14, 2019 · 7 comments · Fixed by #9924
Closed

notifyMode is ignored when used at jest.config.js #8826

felipepastorelima opened this issue Aug 14, 2019 · 7 comments · Fixed by #9924
Labels

Comments

@felipepastorelima
Copy link
Contributor

🐛 Bug Report

The notifyMode is ignored when specified at jest.config.js, but not when used via CLI.
Tested on MacOS Mojave 10.14.5.

To Reproduce

Steps to reproduce the behavior:

// jest.config.js
module.exports = {
  notify: true,
  notifyMode: "failure"
};
// index.test.js
test("ok", () => {
  expect(true).toBe(true);
});

Run jest.

If you run it with jest --notifyMode=failure it will work. (It doesn't show the notify window)

Screen Shot 2019-08-14 at 17 45 24

Expected behavior

Not to show the notify window when notifyMode is failure and all tests pass.

Link to repl or repo (highly encouraged)

Not able to reproduce on repl.it demo.

@SimenB
Copy link
Member

SimenB commented Aug 14, 2019

Huh, seems like a silly bug. Wanna send a PR fixing it? Without digging into it, I'd guess the error is in the normalize function in jest-config

@felipepastorelima
Copy link
Contributor Author

Sure. Thanks for pointing the normalize function. I've made a shallow search and wasn't able to spot the problem. I'll dig into it tomorrow with time.

@felipepastorelima
Copy link
Contributor Author

@SimenB The problem is that the defaults are set to the Argv, but the Argv has higher priority than the jest.config.js options.

It seems to be impacting other variables like 'maxConcurency', for example.

Screen Shot 2019-08-15 at 08 35 40

Screen Shot 2019-08-15 at 08 26 58

Screen Shot 2019-08-15 at 08 05 02

Screen Shot 2019-08-15 at 08 04 00

@SimenB
Copy link
Member

SimenB commented Aug 15, 2019

CLI arguments should win over file config, but not defaults in argv... Not sure how to properly fix this. Ditch defaults from argv, perhaps?

/cc @thymikee @jeysal

@jeysal
Copy link
Contributor

jeysal commented Aug 15, 2019

Yeah I'd say just do not specify yargs defaults, but jest-config Defaults.ts, I think that's what already happens for most things that can be arg and config.

ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Apr 29, 2020
ghostd added a commit to ghostd/jest that referenced this issue Dec 6, 2020
ghostd added a commit to ghostd/jest that referenced this issue Dec 6, 2020
@eungook
Copy link

eungook commented Apr 17, 2021

notifyMode is still ignored. please help! 🙂

ghostd added a commit to ghostd/jest that referenced this issue May 16, 2021
ghostd added a commit to ghostd/jest that referenced this issue May 16, 2021
ghostd added a commit to ghostd/jest that referenced this issue May 16, 2021
@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 Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants