-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove console-testing-library
#4603
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
Remove console-testing-library
#4603
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b4a3670:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
e787d07 to
4a5972b
Compare
8a2b7fd to
e65a623
Compare
|
hmm, what's the benefit of switching away from console-testing-library? |
|
It seemed to be a good idea back then but I think at this point it's more tech debt. I do have a request here though, will add something. |
| const noop = () => {} | ||
| vi.spyOn(console, 'error').mockImplementation(noop) | ||
| }) | ||
| const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(noop) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to suggest that we do
| const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(noop) | |
| using consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(noop) |
inside the tests that actually need this, and skip the mockClear and mockRestore calls, but I'm not sure if vitest actually returns a Disposable here. I know jest does (because I added the functionality there) - could you check if vitest has that now, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I can try it. The type tests will probably fail, so I'll probably exclude the runtime tests from the type tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like vitest doesn't return a Disposable, though I might try to submit a PR to add that functionality for vitest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will definitely be a win in the long run, even if it's not applicable to this PR in the end :)
|
@EskiMojo14 There is multiple reasons:
|
e65a623 to
9d1ebb7
Compare
10738c3 to
bdf6dcc
Compare
6e6368f to
c23567d
Compare
72056e5 to
967bc39
Compare
967bc39 to
34f4e24
Compare
fede3e6 to
f96ba63
Compare
f96ba63 to
bb729ff
Compare
bb729ff to
4dae9e3
Compare
09f70de to
6cc7db3
Compare
901c455 to
255d7db
Compare
255d7db to
3b8bc93
Compare
3b8bc93 to
b4a3670
Compare
This PR:
console-testing-library(part of Centralize tooling configs in monorepo #4138).jest-snapshotfromresolutionsfield of rootpackage.json.