Skip to content

Instantly share code, notes, and snippets.

@classiemilio
Last active October 26, 2017 14:08
Show Gist options
  • Save classiemilio/9e572286149020adf17b0f78a0e3cb33 to your computer and use it in GitHub Desktop.
Save classiemilio/9e572286149020adf17b0f78a0e3cb33 to your computer and use it in GitHub Desktop.
const circle = d3.select('circle');
function transition(radius, duration) {
circle.transition()
.duration(duration)
.attr('r', radius);
}
describe('#transition', () => {
beforeEach(() => {
D3TestUtils.stubAndForceTransitions();
});
afterEach(() => {
D3TestUtils.restoreTransitions();
});
it('correctly transitions circle radius', () => {
transition(50, 1000);
assert.strictEqual(circle.attr('r'), '50');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment