-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
packages/testlab/README.md
Outdated
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"?
There was a problem hiding this 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.
There was a problem hiding this 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.
a7527a5
to
9031040
Compare
Improve testlab's README to show how to use
stubServerRequest
,stubHandlerContext
andstubExpressContext
for mocking/stubbing HTTP request and response objects.Close #760
Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated