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

Add tests #18

Open
Haroenv opened this issue Oct 23, 2018 · 9 comments
Open

Add tests #18

Haroenv opened this issue Oct 23, 2018 · 9 comments

Comments

@Haroenv
Copy link
Contributor

Haroenv commented Oct 23, 2018

  1. add jest to the project
  2. test function with all Gatsby parts being mocked (algoliasearch the module should also be mocked)
  3. think of a proper e2e test later

These are the steps I'm thinking of. @janosh, you said you were interested in contributing, these are the steps I was thinking of

@janosh
Copy link
Contributor

janosh commented Oct 23, 2018

I'll see what I can do this weekend.

@janosh
Copy link
Contributor

janosh commented Nov 12, 2018

Sorry for the delay. Couldn't find any time until now. Where do you want the tests to be located? Inside their own tests/ directory? And what do you mean with

test function with all Gatsby parts being mocked (algoliasearch the module should also be mocked)

Are you thinking of tests that use the example/?

@Haroenv
Copy link
Contributor Author

Haroenv commented Nov 13, 2018

__tests__ is the name we usually use :) I'm not exactly sure what the best way to do it yet. But I meant mocking algoliasearch over all the tests, and just calling our hook with fake input (all mocked too)

@janosh
Copy link
Contributor

janosh commented Nov 13, 2018

I'm not exactly sure what the best way to do it yet.

Should I wait for further instructions then?

@Haroenv
Copy link
Contributor Author

Haroenv commented Nov 13, 2018

It depends if you really want to contribute or not. I won't have time for this for the time coming, but will eventually get back to it :)

@janosh
Copy link
Contributor

janosh commented Nov 13, 2018

I'm happy to help but I don't have a clear idea of what to test and how myself either. Personally, I'm mostly interested in getting the settings PR out (#17) since I'm using gatsby-plugin-algolia across 4 different projects now and would like to avoid switching to my personal fork in all of them.

@Haroenv
Copy link
Contributor Author

Haroenv commented Nov 13, 2018

(just published for you @janosh)

@janosh
Copy link
Contributor

janosh commented Nov 13, 2018

Nice! Thank you very much. My offer to help with testing still stands, of course. I merged upstream master into my fork and installed jest so I'm ready to go. :)

@Haroenv
Copy link
Contributor Author

Haroenv commented Nov 13, 2018

all context I have so far is in the thread, you can let me know how far you got :)

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

No branches or pull requests

2 participants