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(testlab): describe Request/Response mocks #1393

Merged
merged 1 commit into from
Jun 5, 2018

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Jun 4, 2018

Improve testlab's README to show how to use stubServerRequest, stubHandlerContext and stubExpressContext for mocking/stubbing HTTP request and response objects.

Close #760

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@bajtos bajtos added this to the June Milestone milestone Jun 4, 2018
@bajtos bajtos self-assigned this Jun 4, 2018
@dhmlau dhmlau mentioned this pull request Jun 4, 2018
27 tasks
request & response stubs and a promise to observe the actual response as
received by clients.

If your unit under test is expecting a request object only:
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think that under belongs there.

Copy link
Member Author

Choose a reason for hiding this comment

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

@virkt25 In TDD, the phrase "subject under test" used to be pretty common, see e.g. http://xunitpatterns.com/SUT.html

Having said that, I don't really mind how this text is phrased. How should I rewrite this sentence then? Should I change "unit under test" to "tested unit" or "tested function"?

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Very helpful for writing acceptance tests for http/Express request and response.

Copy link
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

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

Kudos for more docs.

@bajtos bajtos force-pushed the docs/request-response-mocks branch from a7527a5 to 9031040 Compare June 5, 2018 07:39
@bajtos bajtos merged commit 2783acf into master Jun 5, 2018
@bajtos bajtos deleted the docs/request-response-mocks branch June 5, 2018 07:54
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.

4 participants