-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add reset function #123
base: master
Are you sure you want to change the base?
Add reset function #123
Conversation
@@ -1446,6 +1447,21 @@ export default class CanvasRenderingContext2D { | |||
this._path.push(event); | |||
} | |||
|
|||
reset() { | |||
if (arguments.length > 0) { | |||
throw new TypeError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the information thrown standardized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean by this. I tried to make it match the information used in the rect
function.
}); | ||
|
||
it('should throw if any parameters are given', () => { | ||
expect(() => ctx.rect(1)).toThrow(TypeError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test the throw message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, something like expect(() => ctx.reset(1)).toThrow(/Failed to execute 'reset' on/);
?
I'm not sure if there is more you need me to do, but if so, please let me know. I am eager to get this merged. Thanks! |
I'd like to use this library, but my project uses the reset function pretty heavily which is currently missing from this mock. This PR adds that function to the mock.