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

Provide tests for cssxref #684

Merged
merged 4 commits into from Apr 12, 2018

Conversation

Projects
None yet
3 participants
@JeremiePat
Contributor

JeremiePat commented Apr 7, 2018

This should be helpful to review pull request #266

I also suggest those who want to write new tests for macros to use that test suite as an inspiration. It should ease writing tests (and we could make that even more generic but, unfortunately, I have no time for this at the moment)

Note: With those tests, you'll notice that the current version of cssxref is broken (uncommenting line 77 in cssxref could be a short term fix)

@jwhitlock

This is an excellent example of fully testing a KumaScript macro. All the branches in the original appear to be tested:

  • Variable number of arguments (1, 2, and 3)
  • Variants based on the type of reference page (property, function, data type)
  • Special cases like <flex>
  • The code is well formatted and clear, like we know what we're doing

This is a strong contender for the example we should give for others to write their tests. Also, it is a great foundation for making further changes to {{cssxref}}.

I'm leaving merging to @Elchi3 (he likes to have an easy merge after a BCD update), and I suggest squashing commits.

@Elchi3 Elchi3 merged commit 2cebe86 into mdn:master Apr 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Elchi3

This comment has been minimized.

Member

Elchi3 commented Apr 12, 2018

Thanks so much for this work. This is really cool! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment