May 2019
Intermediate to advanced
496 pages
10h 38m
English
The exercises for this chapter ask you to use your new domManipulator functions within your other test files.
If you're doing the exercises, you'll see that our other tests make use of the querySelectorAll DOM function. You can build a helper for this with the name elements. You should also wrap the Array.from call when you define this function, as shown:
const elements = selector => Array.from(container.querySelectorAll);
The call to Array.from is noise when it's held within your tests. Pushing it into the helper function allows the test reader to not have to worry about what it does or why it's there.
Read now
Unlock full access