Skip to content

Instantly share code, notes, and snippets.

@classiemilio
Last active October 26, 2017 14:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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