Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes
npm run develop
by running tests after a file has changed. The karma file then runs only the tests that are associated with the file that was changed (instead of all tests).It does this by looking at the passed in file path and matching it against known tests. For example, a file ending with
-matches.js
should run a rule by the same name in therule-matches
directory. This isn't guaranteed to find a file that matches (for example, there are some rule-matches that aren't tested, or some aria checks that don't have the same name of the test file), but karma will alert you if there isn't a test by that name. So you can either fix it (like we should with the aria checks) or ignore it.This also fixes a test failure in the api tests that would happen very sporadically. It turns out that the tree walker was adding comment nodes to the list of elements to use for
randomNodeInTree()
and that would throw off our APIs as we don't expect a comment node to be passed in (sogetNodeFromTree
would fail to return anything).