-
Notifications
You must be signed in to change notification settings - Fork 221
Testing best practices
jtlan edited this page Aug 18, 2015
·
30 revisions
Add more best practices here!
The "length" of a D3 Selection
is always 1, regardless of how many elements are in it:
d3.select().length; // 1, not 0
The correct way to check the size of the Selection
is to assert that its size()
is equal to a particular value:
assert.strictEquals(selection.size(), expectedSize, message);