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

docs: Add documentation for reply accepting a function as the data parameter #1456

Merged
merged 2 commits into from May 23, 2022

Conversation

p16
Copy link
Contributor

@p16 p16 commented May 20, 2022

Following up from this discussion #1185 I thought there was a missing bit in the doc around the fact that the reply data parameter can be a function that will have the mocked request options as input .

@p16 p16 changed the title Add a small paragraph documenting reply accept a function as the data parameter Add documentation for reply accepting a function as the data parameter May 20, 2022
@p16 p16 changed the title Add documentation for reply accepting a function as the data parameter docs: Add documentation for reply accepting a function as the data parameter May 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #1456 (4182fea) into main (324beb6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1456   +/-   ##
=======================================
  Coverage   94.42%   94.42%           
=======================================
  Files          49       49           
  Lines        4271     4271           
=======================================
  Hits         4033     4033           
  Misses        238      238           

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 324beb6...4182fea. Read the comment docs.

@p16
Copy link
Contributor Author

p16 commented May 20, 2022

The failed test

not ok 9 - test/fetch/headers.js # time=4684.681ms
  ---
  env: {}
  file: test/fetch/headers.js
  timeout: 60000
  command: C:\hostedtoolcache\windows\node\16.15.0\x64\node.exe
  args:
    - --expose-gc
    - --experimental-wasm-simd
    - test/fetch/headers.js
  stdio:
    - 0
    - pipe
    - 2
  cwd: D:\a\undici\undici
  exitCode: null
  signal: SIGTERM
  ...

is it a known "flaky" test? it seems something related to the platform more than to the test 🤔

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

docs/best-practices/mocking-request.md Outdated Show resolved Hide resolved
@mcollina
Copy link
Member

Please update the PR title an action fails.

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
@p16
Copy link
Contributor Author

p16 commented May 23, 2022

@mcollina @Fdawgs It seems that the build on latest windows and node 16 is failing ontest/redirect-stream.js (same test result shown in previous message). There is nothing more than what I reported above in the log of that failure. I do not have a window machine ready to test this, is there anyone else that can have a look?

@mcollina mcollina merged commit d478907 into nodejs:main May 23, 2022
@kibertoad
Copy link
Contributor

Documentation deployment is failing now: https://github.com/nodejs/undici/runs/6558409571?check_suite_focus=true

KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
…rameter (nodejs#1456)

* Add a small paragraph documenting reply accept a function as the data parameter

* Update docs/best-practices/mocking-request.md

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
…rameter (nodejs#1456)

* Add a small paragraph documenting reply accept a function as the data parameter

* Update docs/best-practices/mocking-request.md

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
…rameter (nodejs#1456)

* Add a small paragraph documenting reply accept a function as the data parameter

* Update docs/best-practices/mocking-request.md

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
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.

None yet

7 participants