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
Update testing reference guide #435
Conversation
@@ -243,56 +389,6 @@ v('div', { | |||
]) | |||
``` | |||
|
|||
### `harness.expectPartial` |
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.
Removed this because we don't really want to promote its use. With assertion templates it has become less useful as the templates can be easily manipulated but still test the whole widget.
docs/en/testing/supplemental.md
Outdated
|
||
##### Mock `node` Middleware | ||
|
||
Using `createMockNodeMiddleware` from `@dojo/framework/testing/mocks/middleware/node` creates a mock node middleware. To set the expected return from the node mock, call the `mockNode` with a `key` and expected node. |
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.
Given that node could mean a DOM Node or Node.js, I think the first instance of this should be more specific, e.g. creates a mock middleware for a DOM node.
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.
urgh the middleware is called node though.
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.
Yeah it's not a mock middleware for a "DOM nodeit's a mock middleware for the
node` middleware. So think I'm going to leave it as it is.
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.
I would suggest "creates a mock for the node middleware" for ease of reading comprehension.
docs/en/testing/supplemental.md
Outdated
}); | ||
h.expect(/* assertion template for `Loading`*/); | ||
|
||
// would be useful to assert the calls to processes effectively stubbed |
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.
This comment seems a bit weird to be in the docs as it feels more like an internal todo
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.
old comment, good catch.
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.
Sweet! Just the one line to remove I think!
docs/en/testing/basic-usage.md
Outdated
```bash | ||
TESTINGBOT_SECRET=<secret> TESTINGBOT_KEY=<key> dojo test -a -c saucelabs | ||
``` | ||
Using the `setChildren` method of an Assertion Template with the `~key` value you assigned will return a assertion template with the updated virtual DOM structure that you can test your widget output against. | ||
|
||
[browserstack]: https://www.browserstack.com/ |
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.
You can remove this browserstack ref since it's not referenced in this doc anymore.
Co-Authored-By: Dylan Schiemann <dylan@dojotoolkit.org>
afbaf3a
to
f107fb3
Compare
Type: feature
The following has been addressed in the PR:
prettier
as per the readme code style guidelinesDescription:
Update the testing reference guide with new APIs and features for supporting mock middleware.