Skip to content

Use nock to mock HTTP responses in tests #38

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

Merged
merged 1 commit into from
Apr 5, 2023
Merged

Use nock to mock HTTP responses in tests #38

merged 1 commit into from
Apr 5, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Apr 5, 2023

See #31 (comment)

Currently, we're testing the Replicate client by mocking the underlying networking client 1. This provides some assurance that we're calling roughly the right things, but it's too artificial to trust with any certainty.

This PR replaces those mock statements and instead mocks at the networking layer using nock.

Footnotes

  1. Now axios, but soon native fetch. See https://github.com/replicate/replicate-javascript/pull/31

@mattt mattt merged commit 6218765 into main Apr 5, 2023
@mattt mattt deleted the mattt/nock branch April 5, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant