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

test(smokehouse): add numeric comparisons #2356

Merged
merged 3 commits into from
May 27, 2017
Merged

test(smokehouse): add numeric comparisons #2356

merged 3 commits into from
May 27, 2017

Conversation

patrickhulce
Copy link
Collaborator

replaces #2353

@samccone samccone self-requested a review May 25, 2017 18:12
@@ -29,6 +29,7 @@ const DEFAULT_EXPECTATIONS_PATH = 'pwa-expectations';

const PROTOCOL_TIMEOUT_EXIT_CODE = 67;
const RETRIES = 3;
const NUMERICAL_EXPECTATION_REGEXP = /(<|>)(\d+)/;
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@samccone samccone left a 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
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Member

@paulirish paulirish left a 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+)$/;
Copy link
Member

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?

Copy link
Collaborator Author

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

@paulirish paulirish merged commit d5854b6 into master May 27, 2017
@paulirish paulirish deleted the gte_smokehouse branch May 27, 2017 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants