d3-tip
d3-tip copied to clipboard
Add a proper test suite
This project started as a hack to get a minimal svg tooltip working with d3. Nothing at the time existed that targeted SVG specifically. Once it worked well enough for my needs, I documented it and through it up on GitHub. Without a test suite.
Not having a proper test suite created a significant burden to accepting contributions since there was no baseline level checks to ensure that a contributions passed the most basic requirements before code review. Having a test suite would give us confidence that changes we introduce would not break existing assumptions and also raise the quality bar for contributions.
This is pretty high on my personal priority list for this project.
/cc @vdh
A test suite is exactly what I had in mind too. I've had some experience before using the Mocha framework and istanbul for code coverage.
As for testing the actual DOM changes, I'm a bit green there, potentially something using jsdom to simulate the DOM. The more heavy-duty options I've seen out there are PhantomJS or Selenium to run the code within a headless browser/renderer. I've also seen some even-heavier-duty setups that just straight up run the unit tests on the local machine's Chrome browser (of course, I doubt that option would be able to run on CI servers).
I've been pretty happy with tape and jsdom, which is what d3 itself uses. It's a pretty feature-light test suite that likely gives us all we need. Here's some samples from d3-selection: https://github.com/d3/d3-selection/blob/master/test/select-test.js
Hey there! It looks like this issue has been automatically marked as stale because it has not had recent activity. To help the maintainers stay focused, it will be closed if no further activity occurs. Thank you for your contributions.