Skip to content

Commit 30b269b

Browse files
authored
Merge pull request #1562 from tsengia/patch-1
Adding note to testing.md about qunit-dom
2 parents 9931885 + 675dd90 commit 30b269b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/ember/testing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,11 @@ If you’ve been around TypeScript a little, and you look up the type of the `Te
335335

336336
There are still a couple things to be careful about here, however. First, we didn’t specify that the `this.user` property was _optional_. That means that TypeScript won’t complain if you do `this.user` _before_ assigning to it. Second, every test in our module gets the same `Context`. Depending on what you’re doing, that may be fine, but you may end up needing to define multiple distinct test context extensions. If you _do_ end up needing to define a bunch of different test context extension, that may be a sign that this particular set of tests is doing too much. That in turn is probably a sign that this particular _component_ is doing too much!
337337

338+
### QUnit Dom for Component tests
339+
When writing [Component Tests](https://guides.emberjs.com/release/testing/testing-components/), you will use lots of `assert.dom()` calls.
340+
Out of the box, Typescript will complain that `Property 'dom' does not exist on type 'Assert'.`.
341+
342+
This can be fixed by importing `qunit-dom` in your test module:
343+
```typescript
344+
import 'qunit-dom';
345+
```

0 commit comments

Comments
 (0)