Skip to content
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

Fix body parsing and add integration test suite #10

Merged
merged 5 commits into from
Aug 27, 2024
Merged

Conversation

Thomasvdam
Copy link
Member

@Thomasvdam Thomasvdam commented Aug 26, 2024

Motivation

Fixes #9 and an issue where paths without params would break when attempting to inject the parameters.

To help prevent regressions this PR introduces msw to mock HTTP requests.

Explanation of Changes

We have to spin up a new data proxy server on a different port every test as for some reason calling await server.stop() doesn't fully close the proxy server and the next test will spin up a new server on the same port, but the old server receives the request.

We could also do something where we initially prepare a bunch of testcases and attach all the routes to a single proxy, but I didn't want to invest too much time right now.

I also replaced jsonpath with jsonpath-plus as jsonpath required the node_modules directory to be in place as it needs to read files during runtime execution.

Testing

Added integration tests that failed before implementing the fixes.

Related PRs and Issues

Closes: #9

Spawns: #11 #12

Also add a regression test. We have to spin up a new data proxy server
in a different port every test as for some reason calling
`await server.stop()` doesn't fully close the proxy server and the next
test will spin up a new server on the same port, but the old server
receives the request.
jsonpath required the node_modules directory to be in place as it needs
to read files during runtime execution.
@Thomasvdam Thomasvdam merged commit 94b5a22 into main Aug 27, 2024
2 checks passed
@Thomasvdam Thomasvdam deleted the fix/body-parsing branch August 27, 2024 12:39
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.

🐛 Body is not passed correctly
2 participants