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

chore: add jest watch typeahead plugin #143

Merged
merged 2 commits into from
Jul 26, 2019

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Jul 25, 2019

This PR adds typeahead plugin to jest.

@eunjae-lee eunjae-lee requested a review from a team July 25, 2019 14:49
@ghost ghost requested review from francoischalifour and tkrugg and removed request for a team July 25, 2019 14:49
package.json Outdated
@@ -55,6 +55,7 @@
"instantsearch.js": "2.10.5",
"jest": "24.8.0",
"jest-localstorage-mock": "2.4.0",
"jest-watch-typeahead": "^0.3.1",
Copy link
Member

Choose a reason for hiding this comment

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

This should be pinned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not used to it, so I keep forgetting it 😅 Thanks for pointing it out!
Btw, is this guide aligned to what you do?

  1. Any apps (web or node.js) that aren't require()'d by other packages should pin all types of dependencies for greatest reliability/predictability.
  2. Browser or dual browser/node.js libraries that are consumed/required()'d by others should keep using semver ranges for dependencies but can use pinned dependencies for devDependencies.
  3. Node.js-only libraries can consider pinning all dependencies, because application size/duplicate dependencies are not as much a concern in node.js compared to the browser. Of course, don't do that if your library is a micro one likely to be consumed in disk-sensitive environments.

from here

Copy link
Member

Choose a reason for hiding this comment

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

Yep! We follow these rules in our Renovate configuration. It's better to always pin dev dependencies so that every collaborator has exactly the same environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the confirmation!
I wish to have some repo-level configuration which automatically adds --exact when I add devDepencency.
I googled but couldn't find any. I will try not to forget :)

tkrugg
tkrugg previously requested changes Jul 26, 2019
Copy link
Contributor

@tkrugg tkrugg left a comment

Choose a reason for hiding this comment

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

Thanks @eunjae-lee
As françois mentionned, it's best to pin the dependency for consistency but otherwise, cool addition!

@eunjae-lee
Copy link
Contributor Author

eunjae-lee commented Jul 26, 2019

Thanks @eunjae-lee
As françois mentionned, it's best to pin the dependency for consistency but otherwise, cool addition!

Thanks! Just did ;) 93a24e9

@eunjae-lee eunjae-lee merged commit 5012462 into develop Jul 26, 2019
@eunjae-lee eunjae-lee deleted the chore/add-jest-watch-plugin branch July 26, 2019 08:39
eunjae-lee pushed a commit that referenced this pull request Jul 29, 2019
* chore: add jest watch typeahead plugin

* chore: pin dependency
eunjae-lee pushed a commit that referenced this pull request Aug 21, 2019
* fix(compat): disable anonymous tracking on env without cookies

* chore: move supportsCookies to featureDetection

* chore: process queue only on browser

* chore: throw when user token is not set

* chore: add jest watch typeahead plugin (#143)

* chore: add jest watch typeahead plugin

* chore: pin dependency

* chore: add __BROWSER_BUILD__ instead of process.maybeNode

* chore: add __BROWSER_BUILD__ condition

* chore: fix broken test

* chore: remove __BROWSER_BUILD__

* chore: process queue only on browser build

* fix: process queue inside browser module

* chore: fix test cases

* chore: update travis config regarding xvfb (#144)

* chore: rename getAa to getFuctionalInterface

* chore: remove the duplicates

* fix: remove useless argument

* chore: move getInsatnceXX functions to _instance

* fix(compat): node compatibility [PART-3] (#142)

* chore: add util functions and tests

* chore: add request function which wraps sendBeacon, xhr and node http

* chore: apply feedback

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: apply feedbacks

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: require http/https dynamically to clean browser build

* chore: remove node http related code from browser build

* chore: remove __BROWSER_BUILD__

* chore: fix tests for sendEvent in node

* fix: pass requestFn to AlgoliaAnalytics

* chore: remove _instance and use AlgoliaAnalytics instead

* chore: split getRequester

* fix: change parameters of request for node 8.x

node 8.x and 10.x have different signautures for 'request' function.

- node 8.x: https://nodejs.org/docs/latest-v8.x/api/https.html#https_https_request_options_callback
- node 10.x: https://nodejs.org/dist/latest-v10.x/docs/api/https.html#https_https_request_options_callback

* fix: allow userToken in event payload

* fix: remove the duplicated assignment
tkrugg added a commit that referenced this pull request Aug 26, 2019
* chore: configure rollup to generate two builds

* chore: remove unused option (browser) from rollup config

* chore: add process.maybeNode

* chore: add __BROWSER_BUILD__ instead of process.maybeNode

* chore: make two entries

* chore: export aa function in node build

* chore: instantiate AlgoliaInsights every time in tests

* chore: rename entry files

* chore: use top-level beforeEach

* chore: rename getAa to getFuctionalInterface

* fix(compat): node compatibility [PART-2] (#141)

* fix(compat): disable anonymous tracking on env without cookies

* chore: move supportsCookies to featureDetection

* chore: process queue only on browser

* chore: throw when user token is not set

* chore: add jest watch typeahead plugin (#143)

* chore: add jest watch typeahead plugin

* chore: pin dependency

* chore: add __BROWSER_BUILD__ instead of process.maybeNode

* chore: add __BROWSER_BUILD__ condition

* chore: fix broken test

* chore: remove __BROWSER_BUILD__

* chore: process queue only on browser build

* fix: process queue inside browser module

* chore: fix test cases

* chore: update travis config regarding xvfb (#144)

* chore: rename getAa to getFuctionalInterface

* chore: remove the duplicates

* fix: remove useless argument

* chore: move getInsatnceXX functions to _instance

* fix(compat): node compatibility [PART-3] (#142)

* chore: add util functions and tests

* chore: add request function which wraps sendBeacon, xhr and node http

* chore: apply feedback

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: apply feedbacks

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: require http/https dynamically to clean browser build

* chore: remove node http related code from browser build

* chore: remove __BROWSER_BUILD__

* chore: fix tests for sendEvent in node

* fix: pass requestFn to AlgoliaAnalytics

* chore: remove _instance and use AlgoliaAnalytics instead

* chore: split getRequester

* fix: change parameters of request for node 8.x

node 8.x and 10.x have different signautures for 'request' function.

- node 8.x: https://nodejs.org/docs/latest-v8.x/api/https.html#https_https_request_options_callback
- node 10.x: https://nodejs.org/dist/latest-v10.x/docs/api/https.html#https_https_request_options_callback

* fix: allow userToken in event payload

* fix: remove the duplicated assignment

* fix: check userToken for only undefined

* chore: rename AlgoliaInsights with analyticsInstance in test cases

* fix: add `new` at `TypeError`s

Co-Authored-By: Haroen Viaene <[email protected]>

* chore: apply suggestions from code review

Co-Authored-By: Haroen Viaene <[email protected]>

* fix: update inline snapshot of test case

* fix: add `new` at `TypeError`s

* chore: inline AlgoliaAnalyticsOptions type

* chore: use `isUndefined` helper

* fix: throw when userToken is an empty string

* fix: improve test case

* fix: split a test case

* chore: update feedback from review

Co-Authored-By: Youcef Mammar <[email protected]>
eunjae-lee pushed a commit that referenced this pull request Sep 9, 2019
* docs(readme): update documentation (#153)

* docs(readme): update documentation

* docs(migration): add migration file

* chore(package): update description

* docs(readme): fix license link (#154)

* chore(deps): update dependency html-webpack-plugin to v3 (#85)

* chore(deps): update dependency @types/jest to v24.0.18 (#147)

* chore(deps): update dependency dotenv to v8.1.0 (#152)

* chore(deps): update dependency jest to v24.9.0 (#150)

* chore(deps): update node.js to v8.16.1 (#151)

* chore(deps): update dependency puppeteer to v1.19.0 (#124)

* docs(readme): convert `positions` to numbers (#156)

* fix(compat): node compatibility (#140)

* chore: configure rollup to generate two builds

* chore: remove unused option (browser) from rollup config

* chore: add process.maybeNode

* chore: add __BROWSER_BUILD__ instead of process.maybeNode

* chore: make two entries

* chore: export aa function in node build

* chore: instantiate AlgoliaInsights every time in tests

* chore: rename entry files

* chore: use top-level beforeEach

* chore: rename getAa to getFuctionalInterface

* fix(compat): node compatibility [PART-2] (#141)

* fix(compat): disable anonymous tracking on env without cookies

* chore: move supportsCookies to featureDetection

* chore: process queue only on browser

* chore: throw when user token is not set

* chore: add jest watch typeahead plugin (#143)

* chore: add jest watch typeahead plugin

* chore: pin dependency

* chore: add __BROWSER_BUILD__ instead of process.maybeNode

* chore: add __BROWSER_BUILD__ condition

* chore: fix broken test

* chore: remove __BROWSER_BUILD__

* chore: process queue only on browser build

* fix: process queue inside browser module

* chore: fix test cases

* chore: update travis config regarding xvfb (#144)

* chore: rename getAa to getFuctionalInterface

* chore: remove the duplicates

* fix: remove useless argument

* chore: move getInsatnceXX functions to _instance

* fix(compat): node compatibility [PART-3] (#142)

* chore: add util functions and tests

* chore: add request function which wraps sendBeacon, xhr and node http

* chore: apply feedback

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: apply feedbacks

Co-Authored-By: Youcef Mammar <[email protected]>

* chore: require http/https dynamically to clean browser build

* chore: remove node http related code from browser build

* chore: remove __BROWSER_BUILD__

* chore: fix tests for sendEvent in node

* fix: pass requestFn to AlgoliaAnalytics

* chore: remove _instance and use AlgoliaAnalytics instead

* chore: split getRequester

* fix: change parameters of request for node 8.x

node 8.x and 10.x have different signautures for 'request' function.

- node 8.x: https://nodejs.org/docs/latest-v8.x/api/https.html#https_https_request_options_callback
- node 10.x: https://nodejs.org/dist/latest-v10.x/docs/api/https.html#https_https_request_options_callback

* fix: allow userToken in event payload

* fix: remove the duplicated assignment

* fix: check userToken for only undefined

* chore: rename AlgoliaInsights with analyticsInstance in test cases

* fix: add `new` at `TypeError`s

Co-Authored-By: Haroen Viaene <[email protected]>

* chore: apply suggestions from code review

Co-Authored-By: Haroen Viaene <[email protected]>

* fix: update inline snapshot of test case

* fix: add `new` at `TypeError`s

* chore: inline AlgoliaAnalyticsOptions type

* chore: use `isUndefined` helper

* fix: throw when userToken is an empty string

* fix: improve test case

* fix: split a test case

* chore: update feedback from review

Co-Authored-By: Youcef Mammar <[email protected]>

* docs: add a section for Node.js module (#145)

* docs: add a section for node module

* docs: add TOC

* docs: apply feedbacks

Co-Authored-By: Youcef Mammar <[email protected]>

* docs: move Node.js part under getting started

* docs: update setUserToken part

* docs: apply changes again

* docs: apply suggestions from code review

Co-Authored-By: François Chalifour <[email protected]>

* docs: apply feedbacks

* docs: update TOC

* chore: update version
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.

3 participants