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

feat(mocha): add test runner wrapper + remove redundant code #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mastertheblaster
Copy link

No description provided.

yanivefraim
yanivefraim previously approved these changes May 15, 2018
@yanivefraim
Copy link
Collaborator

You should change the name of the PR... it is a refactor now (;
Let me know when you finish

@yanivefraim
Copy link
Collaborator

Sorry, I actually see you added some features, so not a refactor, feature/s...

@mastertheblaster
Copy link
Author

yes, currently i didn't break the existing API.
i only added a new file mocha.js which exposes withEyes method. Check the readme.
currently it's the only way to properly get and use test title.
also usage is more simple. for my project its' more than enough.
what do you say ?

@mastertheblaster mastertheblaster changed the title chore(deps): remove unused stuff feat(mocha): add test runner wrapper + remove redundant code May 15, 2018
Copy link
Collaborator

@yanivefraim yanivefraim left a 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);
Copy link
Collaborator

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.

Copy link
Author

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.

Copy link
Author

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.

Copy link
Author

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

Copy link
Collaborator

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?

Copy link
Author

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

Copy link
Collaborator

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');
Copy link
Collaborator

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)

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

2 participants