Closed danstarns closed 2 months ago
Latest commit: 78f491af9623fd172abbcdd53fb4e1ca07658d79
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
What?
child_process
Why
Using
child_process
can be brittle and there are already tested tools that allow us to interact with Docker programmatically, we should use those for better readability and maintainability.The CLI had few tests, so to make assertive changes here, I first added coverage for the CLI and then returned to make the dockerode / SDK changes.
How
Usage of npm package https://github.com/apocas/dockerode replaces
child_process
calls.Vitest is added under
pnpm test:unit
in the CLI package, mocks are used to interact with and assert the CLI.Refactors have been made for readability and to enable the mocking of modules in tests.