-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(mocha): add test runner wrapper + remove redundant code #11
base: master
Are you sure you want to change the base?
Conversation
You should change the name of the PR... it is a refactor now (; |
Sorry, I actually see you added some features, so not a refactor, feature/s... |
yes, currently i didn't break the existing API. |
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.
Cool, I’ll go over the PR tomorrow (too tired...)
const theEyes = new Eyes(); | ||
|
||
theEyes.setOs(process.platform); | ||
theEyes.setApiKey(process.env.EYES_API_KEY); |
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 get it right, this code will run when you require eyes.js
, regardless you have api key or not, which might end with an error, in case you do not have an api key.
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 have already checked that manually. It allows to pass '', undefined, null value anything.
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.
The main question about this PR is that it changes the approach.
It's more like original eyes.it
, but with less coupling and maybe more readable.
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.
It's not matcher anymore
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.
yes... we might consider maybe to move this to a different package, or change package name. I think that a different package will be cleaner. WDYT?
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.
ok, will move to package with-eyes
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 think that we will want to have at least an option for batching with the matcher (I didn't have time to think about it, yet). WDYT?
@@ -1,22 +1,44 @@ | |||
const [, , , chaiToMatchScreenshot, browserWSEndpoint] = process.argv; | |||
const {Assertion, expect} = require('chai'); | |||
const {withEyes} = require('../../mocha'); |
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.
We're running this test in a different process and passing other links to require via arguments. Not sure this is the best solution but we might want to be aligned with the same method for all requires? (no matter which we choose)
No description provided.