Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Launch unsupported invocations of tsh ssh in local shell #676

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

ravicious
Copy link
Member

Also removes some leftovers from quick pickers.

Comment on lines +3 to +7
// Jest doesn't let us selectively automock classes. See https://github.com/facebook/jest/issues/11995
//
// So instead for now we just mock all classes in the module and then do `jest.requireActual` when
// we need to have the actual class when writing tests for it.
jest.mock('./quickPickers');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that I want to be able to selectively mock some classes from the imported module. But Jest allows me to either automock all of them or manually mock only selected imports.

Manually mocking stuff is super cumbersome, like cmon, the computer should be able to do it for me. And the solution I chose is wack too but better than manual mocking.

jest-create-mock-instance is one option, it'd make using mocks so much easier and its source code is very short. But idk about adding a package that can theoretically stop us from updating Jest. Jest should really come with something for that OOTB. :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, jest-create-mock-instance would block as from upgrading jest, so IMO it is not an option.
I think the solution you selected is not that bad, I'd stay with it for now.

@ravicious ravicious requested a review from gzdunek March 17, 2022 16:43
@ravicious ravicious enabled auto-merge (rebase) March 18, 2022 10:48
@ravicious ravicious force-pushed the ravicious/command-bar-tsh-ssh-options branch from afa37af to 93c94d7 Compare March 18, 2022 10:48
@ravicious ravicious merged commit 8c69135 into master Mar 18, 2022
@ravicious ravicious deleted the ravicious/command-bar-tsh-ssh-options branch March 18, 2022 10:55
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 this pull request may close these issues.

2 participants