Skip to content

Conversation

@mgrybyk
Copy link
Member

@mgrybyk mgrybyk commented Sep 10, 2020

#185

@mgrybyk mgrybyk added the documentation Improvements or additions to documentation label Sep 10, 2020
@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #201 into master will increase coverage by 0.97%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
+ Coverage   74.64%   75.62%   +0.97%     
==========================================
  Files          40       40              
  Lines         852      886      +34     
  Branches      205      221      +16     
==========================================
+ Hits          636      670      +34     
  Misses        203      203              
  Partials       13       13              
Impacted Files Coverage Δ
src/matchers/mock/toBeRequestedWith.ts 98.10% <0.00%> (+0.52%) ⬆️

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 a769358...6409552. Read the comment docs.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the following example:

expect(mock).toBeRequestedWith({
    url: 'http://localhost:8080/api/todo',          // [optional] string | function | custom matcher
    method: 'POST',                                 // [optional] string | array
    requestHeaders: { Authorization: 'foo' },       // [optional] object | function | custom matcher
    responseHeaders: { Authorization: 'bar' },      // [optional] object | function | custom matcher
    request: { title: 'foo', description: 'bar' },  // [optional] object | function | custom matcher
    response: { success: true },                    // [optional] object | function | custom matcher
})

What is the request property suppose to represent here? The request payload or its params? Maybe it is more clear if it is called requestPayload.

We can do a separate PR for it. These docs changes look good 👍

@mgrybyk
Copy link
Member Author

mgrybyk commented Sep 14, 2020

It represents the request payload.
I can rename it to what you've suggested or to postData according to the puppeteer docs https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#httprequestpostdata

@christian-bromann
Copy link
Member

@mgrybyk postData sounds good to me.

@mgrybyk
Copy link
Member Author

mgrybyk commented Sep 14, 2020

#208

@mgrybyk mgrybyk merged commit eecdd84 into master Sep 14, 2020
@mgrybyk
Copy link
Member Author

mgrybyk commented Sep 14, 2020

@christian-bromann merged this one because webdriverio/webdriverio#5818 is merged

@mgrybyk mgrybyk deleted the network-mock-docs branch October 13, 2020 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants