Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

test: add HTTP tests that cover actual behaviours #2174

Merged
merged 1 commit into from
Jun 18, 2020
Merged

Conversation

faustbrian
Copy link
Contributor

The previous HttpClient tests mocked everything which meant nothing was actually tested. The tests now use fake response with nock which makes sure that requests are sent to the correct URLs and return an actual response body.

Replaced axios with node-fetch because it was causing problems with nock but both of them anyways are just temporary solutions because something else will have to be used to support proxies.

@ghost ghost added Complexity: Medium Less than 256 lines changed. Test: Unit The issue or pull request is related to unit tests for testing individual elements. labels Jun 18, 2020
@codecov
Copy link

codecov bot commented Jun 18, 2020

Codecov Report

Merging #2174 into 3.0-react will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           3.0-react     #2174    +/-   ##
============================================
  Coverage     100.00%   100.00%            
============================================
  Files             24       112    +88     
  Lines            142       882   +740     
  Branches          18       136   +118     
============================================
+ Hits             142       882   +740     
Flag Coverage Δ
#unit 100.00% <100.00%> (?)
Impacted Files Coverage Δ
src/app/components/Button/Button.tsx 100.00% <ø> (ø)
src/app/components/Card/Card.tsx 100.00% <ø> (ø)
src/app/components/Card/CardControl.tsx 100.00% <ø> (ø)
src/app/components/StepIndicator/StepIndicator.tsx 100.00% <ø> (ø)
src/app/components/Address/Address.tsx 100.00% <100.00%> (ø)
src/app/components/Address/utils.ts 100.00% <100.00%> (ø)
src/app/components/Alert/Alert.tsx 100.00% <100.00%> (ø)
src/app/components/Badge/Badge.styles.ts 100.00% <100.00%> (ø)
src/app/components/Badge/Badge.tsx 100.00% <100.00%> (ø)
src/app/components/Button/Button.styles.ts 100.00% <100.00%> (ø)
... and 142 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6466b1...9733613. Read the comment docs.

@faustbrian faustbrian merged commit 8707160 into 3.0-react Jun 18, 2020
@ghost ghost deleted the http-tests branch June 18, 2020 04:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complexity: Medium Less than 256 lines changed. Test: Unit The issue or pull request is related to unit tests for testing individual elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant