Skip to content

Conversation

@Kurt-von-Laven
Copy link
Contributor

Move the util.promisify() call in src/util.ts from the top level to execBashCommand(). Mock util.promisify() in tests now that it is simpler to do so before util.promisify() is called. Introduce src/mocks/util.ts to share the util mock factory between tests.

@Kurt-von-Laven Kurt-von-Laven requested a review from mwarres March 25, 2023 18:35
@Kurt-von-Laven Kurt-von-Laven self-assigned this Mar 25, 2023
Copy link
Contributor

@mwarres mwarres left a comment

Choose a reason for hiding this comment

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

LGTM!

Move the util.promisify() call in src/util.ts from the top level to
execBashCommand(). Mock util.promisify() in tests now that it is simpler
to do so before util.promisify() is called. Introduce src/mocks/util.ts
to share the util mock factory between tests.
@Kurt-von-Laven
Copy link
Contributor Author

I was able to simplify considerably by replacing some unnecessary uses of mockImplementation* with mockReturnValue*.

Copy link
Contributor

@mwarres mwarres left a comment

Choose a reason for hiding this comment

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

Looks good overall, I'm not sure about the syntax on the area I commented on though.

Copy link
Contributor

@mwarres mwarres left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kurt-von-Laven Kurt-von-Laven merged commit 7f9f984 into main Mar 28, 2023
@Kurt-von-Laven Kurt-von-Laven deleted the util branch March 28, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants