Skip to content
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

[feature] Implement a clone method for durations, fixes #4078 #4080

Closed
wants to merge 3 commits into from

Conversation

ashsearle
Copy link
Contributor

No description provided.

var durationB = durationA.clone();
durationA.add(5, 'milliseconds');
assert.equal(durationB.milliseconds(), 5, 'Calling duration.clone() on a duration will create a clone');
assert.equal(durationA.milliseconds(), 10, 'Calling duration.clone() on a duration will create a clone');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make more sense to test that durationA.milliseconds() does not equal durationB.milliseconds(). That would test that the object had in fact been cloned more explicitly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - I've updated code, along with the original unit-tests I copied this logic from.

@maggiepint maggiepint mentioned this pull request Jul 25, 2017
@ichernev ichernev changed the title Fix #4078: Implement a clone method for durations [feature] Implement a clone method for durations, fixes #4078 Aug 3, 2017
@ichernev
Copy link
Contributor

ichernev commented Aug 7, 2017

Merged in 2847a99

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

Successfully merging this pull request may close these issues.

None yet

3 participants