-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
test(smokehouse): add numeric comparisons #2356
Conversation
@@ -29,6 +29,7 @@ const DEFAULT_EXPECTATIONS_PATH = 'pwa-expectations'; | |||
|
|||
const PROTOCOL_TIMEOUT_EXIT_CODE = 67; | |||
const RETRIES = 3; | |||
const NUMERICAL_EXPECTATION_REGEXP = /(<|>)(\d+)/; |
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.
/^(<|>)(\d+)$/
to tighten it up a bit.
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.
done
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.
lgtm % 1 comment
* - Regular expressions | ||
* - Strict equality | ||
* | ||
* @param {*} actual |
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.
if i am reading your code correctly..
{string|number} actual
{RegExp|string} expected
I think these are the types
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.
nah it can be any, the Object.is catch-all does boolean and number expectations too, objects will also be passed in but will always be false
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.
this is nice. we did this sorta thing in pwmetrics and its been lovely.
one question
@@ -29,6 +29,7 @@ const DEFAULT_EXPECTATIONS_PATH = 'pwa-expectations'; | |||
|
|||
const PROTOCOL_TIMEOUT_EXIT_CODE = 67; | |||
const RETRIES = 3; | |||
const NUMERICAL_EXPECTATION_REGEXP = /^(<|>)(\d+)$/; |
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.
seems like it should handle <=
as people would expect it, yah?
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.
heh yeah I suppose you're right
replaces #2353