Skip to content
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

chore: fix grunt develop #2692

Merged
merged 1 commit into from
Dec 16, 2020
Merged

chore: fix grunt develop #2692

merged 1 commit into from
Dec 16, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Dec 15, 2020

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 the rule-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 (so getNodeFromTree would fail to return anything).

@straker straker requested a review from a team as a code owner December 15, 2020 23:09
Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document this.

Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, assuming docs follow shortly.

@straker straker merged commit 4dfddbd into develop Dec 16, 2020
@straker straker deleted the grunt-develop branch December 16, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants