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

Install Jest/Nock #13

Open
harley-harris opened this issue May 11, 2023 · 4 comments
Open

Install Jest/Nock #13

harley-harris opened this issue May 11, 2023 · 4 comments

Comments

@harley-harris
Copy link
Collaborator

No description provided.

@huwd
Copy link
Member

huwd commented Jun 1, 2023

This is probably our focus, right?
You want to do more testing with the final days?

If you're looking for ideas of what to test. I'd recommend taking a browse around:
https://github.com/alphagov/gds-api-adapters/tree/main/test

perhaps especially the test suite for the base client and JSON_client.

If it's any help I stole all this code the other day for a side project I'm working on (MIT license :D) and rewrote these tests into Rspec which is very similar to Jest syntax.

These are all fundimentally good GOV.UK tests, so not really my code.
But have a look at the "it" statements here and the expects. Might give some ideas for things to test for:
https://github.com/huwd/api_adaptor/blob/main/spec/lib/api_adaptor/json_client_spec.rb

  • what are you going to do if the APIs return a 5xx error?
  • or a 400?

How will you handle those?

@harley-harris harley-harris changed the title Install Jest (to be used for unit testing functions) Install Jest/Nock Jun 2, 2023
@harley-harris harley-harris changed the title Install Jest/Nock Install Jest/Nock (consider requests) Jun 8, 2023
@harley-harris
Copy link
Collaborator Author

@harley-harris harley-harris changed the title Install Jest/Nock (consider requests) Install Jest/Nock Jun 9, 2023
@harley-harris
Copy link
Collaborator Author

@harley-harris
Copy link
Collaborator Author

nock/nock#2397

harley-harris added a commit that referenced this issue Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants