From df1473762195376a4885b0139a6715e8a7825d24 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Wed, 19 Jul 2023 17:47:01 +0200 Subject: [PATCH 1/6] test(helper): integrate jest tests into main config This allows us to run the tests from the root WIP: revert the part of integration tests, as it should be separately retried probably --- .eslintrc.js | 5 +- jest.config.js | 8 ++- .../integration-spec/helper.derive.js | 2 +- .../integration-spec/helper.distinct.facet.js | 2 +- .../integration-spec/helper.filters.js | 2 +- .../integration-spec/helper.geo.js | 2 +- .../integration-spec/helper.highlight.js | 2 +- .../integration-spec/helper.insights.js | 2 +- .../integration-spec/helper.numerics.js | 2 +- .../helper.results.getFacetValues.js | 2 +- .../helper.searchForFacetValues.js | 2 +- .../integration-spec/helper.searchOnce.js | 2 +- .../integration-spec/helper.tags.js | 2 +- .../SearchParameters/RefinementList/clear.js | 0 .../_clearNumericRefinements.js | 0 .../spec/SearchParameters/_parseNumbers.js | 0 .../spec/SearchParameters/constructorFn.js | 0 .../getConjunctiveRefinements.js | 0 .../getDisjunctiveRefinements.js | 0 .../SearchParameters/getExcludeRefinements.js | 0 .../hierarchical-facets/add.js | 0 .../hierarchical-facets/remove.js | 0 .../isDisjunctiveFacetRefined.js | 0 .../spec/SearchParameters/isExcludeRefined.js | 0 .../spec/SearchParameters/isFacetRefined.js | 0 .../isHierarchicalFacetRefined.js | 0 .../spec/SearchParameters/isNumericRefined.js | 0 .../spec/SearchParameters/listAttributes.js | 0 .../spec/SearchParameters/noChanges.js | 0 .../SearchParameters/numericAttributes.js | 0 .../spec/SearchParameters/numericFilters.js | 0 .../spec/SearchParameters/removeXFacet.js | 0 .../removeXFacetRefinement.js | 0 .../spec/SearchParameters/resetPage.js | 0 .../SearchParameters/setQueryParameter.js | 0 .../SearchParameters/setQueryParameters.js | 0 .../spec/SearchResults/getFacet.js | 2 +- .../spec/SearchResults/getFacetStats.js | 0 .../getFacetValues-facetOrdering.js | 0 .../spec/SearchResults/getFacetValues.js | 0 .../getFacetValues/conjunctive.json | 0 .../getFacetValues/disjunctive.json | 0 .../getFacetValues/hierarchical.json | 0 .../getFacetValues/noFilters.json | 0 .../SearchResults/getFacetValues/sparse.json | 0 .../spec/SearchResults/getRefinements.js | 0 .../conjunctive-brand-apple.json | 0 .../disjunctive-type-trendcase.json | 0 .../getRefinements/dummy-tags.json | 0 .../getRefinements/exclude-apple.json | 0 .../exclude-artificial-results.json | 0 .../getRefinements/hierarchical-cards.json | 0 .../getRefinements/noFilters.json | 0 .../getRefinements/numeric-rating-3.json | 0 .../spec/SearchResults/initialization.js | 0 .../addFacetRefinement.js | 0 .../spec/algoliasearch.helper/clears.js | 0 .../spec/algoliasearch.helper/client.js | 0 .../spec/algoliasearch.helper/constructor.js | 0 .../algoliasearch.helper/derive/detach.js | 0 .../derive/empty-index.js | 0 .../algoliasearch.helper/derive/events.js | 0 .../derive/multiqueries.js | 0 .../spec/algoliasearch.helper/distinct.js | 0 .../spec/algoliasearch.helper/events.js | 0 .../spec/algoliasearch.helper/excludes.js | 0 .../spec/algoliasearch.helper/facetFilters.js | 0 .../spec/algoliasearch.helper/findAnswers.js | 0 .../getNumericRefinement.js | 0 .../spec/algoliasearch.helper/getQuery.js | 0 .../algoliasearch.helper/hasRefinements.js | 0 .../incorrectFacetDefinition.js | 0 .../algoliasearch.helper/numericFilters.js | 0 .../spec/algoliasearch.helper/pages.js | 0 .../algoliasearch.helper/pendingSearch.js | 8 +-- .../spec/algoliasearch.helper/queryID.js | 2 +- .../searchForFacetValues.js | 0 .../spec/algoliasearch.helper/searchOnce.js | 2 +- .../algoliasearch.helper/setQueryParameter.js | 0 .../spec/algoliasearch.helper/state.js | 0 .../spec/algoliasearch.helper/tags.js | 0 .../spec/functions/compact.js | 0 .../spec/functions/defaultsPure.js | 0 .../spec/functions/find.js | 0 .../spec/functions/findIndex.js | 0 .../spec/functions/formatSort.js | 0 .../spec/functions/intersection.js | 0 .../spec/functions/merge.js | 0 .../spec/functions/orderBy.js | 0 .../spec/functions/valToNumber.js | 0 .../spec/hierarchical-facets/add-remove.js | 0 .../hierarchical-facets/attributes-order.js | 0 .../spec/hierarchical-facets/breadcrumb.js | 0 .../hierarchical-facets/custom-prefix-path.js | 0 .../hierarchical-facets/custom-separator.js | 0 .../do-not-show-parent-level.js | 0 .../hierarchical-facets/facet-value-length.js | 0 .../hierarchical-facets/getFacetValues.js | 0 .../spec/hierarchical-facets/no-refinement.js | 0 .../spec/hierarchical-facets/no-trim.js | 0 .../objects-with-multiple-categories.js | 0 .../spec/hierarchical-facets/one-level.js | 0 .../spec/hierarchical-facets/pagination.js | 0 .../parent-toggleRefine.js | 0 .../hierarchical-facets/refined-no-result.js | 0 .../hierarchical-facets/show-parent-level.js | 0 .../spec/hierarchical-facets/simple-usage.js | 0 .../spec/hierarchical-facets/sort-by.js | 0 .../spec/hierarchical-facets/two-facets.js | 0 .../spec/hierarchical-facets/unknown-facet.js | 0 .../with-a-disjunctive-facet.js | 0 .../{test => __tests__}/spec/refinements.js | 0 .../spec/requestBuilder.js | 12 +++-- .../{test => __tests__}/spec/search.js | 4 +- .../spec/utils/isValidUserToken.js | 0 packages/algoliasearch-helper/jest.setup.js | 5 -- .../test/integration-utils.js | 7 +++ packages/algoliasearch-helper/test/run.js | 52 ------------------- tests/utils/setupTests.ts | 9 ++++ tests/utils/teardownTests.ts | 34 ++++++++++++ 120 files changed, 89 insertions(+), 83 deletions(-) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.derive.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.distinct.facet.js (96%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.filters.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.geo.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.highlight.js (96%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.insights.js (94%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.numerics.js (98%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.results.getFacetValues.js (95%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.searchForFacetValues.js (99%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.searchOnce.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/integration-spec/helper.tags.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/RefinementList/clear.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/_clearNumericRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/_parseNumbers.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/constructorFn.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/getConjunctiveRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/getDisjunctiveRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/getExcludeRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/hierarchical-facets/add.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/hierarchical-facets/remove.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/isDisjunctiveFacetRefined.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/isExcludeRefined.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/isFacetRefined.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/isHierarchicalFacetRefined.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/isNumericRefined.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/listAttributes.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/noChanges.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/numericAttributes.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/numericFilters.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/removeXFacet.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/removeXFacetRefinement.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/resetPage.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/setQueryParameter.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchParameters/setQueryParameters.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacet.js (84%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetStats.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues-facetOrdering.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues/conjunctive.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues/disjunctive.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues/hierarchical.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues/noFilters.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getFacetValues/sparse.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/conjunctive-brand-apple.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/disjunctive-type-trendcase.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/dummy-tags.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/exclude-apple.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/exclude-artificial-results.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/hierarchical-cards.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/noFilters.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/getRefinements/numeric-rating-3.json (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/SearchResults/initialization.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/addFacetRefinement.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/clears.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/client.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/constructor.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/derive/detach.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/derive/empty-index.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/derive/events.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/derive/multiqueries.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/distinct.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/events.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/excludes.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/facetFilters.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/findAnswers.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/getNumericRefinement.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/getQuery.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/hasRefinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/incorrectFacetDefinition.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/numericFilters.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/pages.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/pendingSearch.js (93%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/queryID.js (96%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/searchForFacetValues.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/searchOnce.js (97%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/setQueryParameter.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/state.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/algoliasearch.helper/tags.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/compact.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/defaultsPure.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/find.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/findIndex.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/formatSort.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/intersection.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/merge.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/orderBy.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/functions/valToNumber.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/add-remove.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/attributes-order.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/breadcrumb.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/custom-prefix-path.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/custom-separator.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/do-not-show-parent-level.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/facet-value-length.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/getFacetValues.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/no-refinement.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/no-trim.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/objects-with-multiple-categories.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/one-level.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/pagination.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/parent-toggleRefine.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/refined-no-result.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/show-parent-level.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/simple-usage.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/sort-by.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/two-facets.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/unknown-facet.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/hierarchical-facets/with-a-disjunctive-facet.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/refinements.js (100%) rename packages/algoliasearch-helper/{test => __tests__}/spec/requestBuilder.js (95%) rename packages/algoliasearch-helper/{test => __tests__}/spec/search.js (95%) rename packages/algoliasearch-helper/{test => __tests__}/spec/utils/isValidUserToken.js (100%) delete mode 100644 packages/algoliasearch-helper/jest.setup.js delete mode 100644 packages/algoliasearch-helper/test/run.js create mode 100644 tests/utils/teardownTests.ts diff --git a/.eslintrc.js b/.eslintrc.js index 5d6ce4f7c1..e6a85da5eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -429,7 +429,10 @@ const config = { }, }, { - files: ['packages/algoliasearch-helper/test/**/*.js'], + files: [ + 'packages/algoliasearch-helper/__tests__/**/*.js', + 'packages/algoliasearch-helper/test/**/*.js', + ], rules: { 'no-console': 'off', 'jest/no-done-callback': 'off', diff --git a/jest.config.js b/jest.config.js index b3fbb1af55..31d37416c0 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,21 +1,27 @@ // @ts-check +const enableIntegrationTest = + process.env.ONLY_UNIT !== 'true' && + process.env.INTEGRATION_TEST_API_KEY && + process.env.INTEGRATION_TEST_APPID; + /** @type {import('@jest/types').Config.InitialOptions} */ const config = { rootDir: process.cwd(), testRunner: 'jest-circus', testEnvironment: 'node', setupFilesAfterEnv: ['./tests/utils/setupTests.ts'], + globalTeardown: './tests/utils/teardownTests.ts', testPathIgnorePatterns: [ '/node_modules/', '/packages/*/node_modules/', '/packages/*/dist*', '/tests/e2e/*', '/examples/', - '/packages/algoliasearch-helper', '/packages/create-instantsearch-app', '/packages/react-instantsearch-hooks-router-nextjs', '/__utils__/', + enableIntegrationTest ? '' : '/integration-spec/', ], watchPathIgnorePatterns: [ '/packages/*/cjs', diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.derive.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js similarity index 97% rename from packages/algoliasearch-helper/test/integration-spec/helper.derive.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js index 5b98efa33e..89876ba44f 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.derive.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.distinct.facet.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js similarity index 96% rename from packages/algoliasearch-helper/test/integration-spec/helper.distinct.facet.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js index cb3752fa68..4930bc3dc9 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.distinct.facet.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.filters.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js similarity index 97% rename from packages/algoliasearch-helper/test/integration-spec/helper.filters.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js index 627bce9b93..6038e421cf 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.filters.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.geo.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js similarity index 97% rename from packages/algoliasearch-helper/test/integration-spec/helper.geo.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js index 027479a37c..ea83a84f17 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.geo.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.highlight.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js similarity index 96% rename from packages/algoliasearch-helper/test/integration-spec/helper.highlight.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js index 87a91586b1..32894764f5 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.highlight.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.insights.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js similarity index 94% rename from packages/algoliasearch-helper/test/integration-spec/helper.insights.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js index 7a0b9ca608..4756055228 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.insights.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.numerics.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js similarity index 98% rename from packages/algoliasearch-helper/test/integration-spec/helper.numerics.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js index 21459f4cf5..2efb6919f2 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.numerics.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.results.getFacetValues.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js similarity index 95% rename from packages/algoliasearch-helper/test/integration-spec/helper.results.getFacetValues.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js index 0dbf72b958..f71ed69c78 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.results.getFacetValues.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.searchForFacetValues.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js similarity index 99% rename from packages/algoliasearch-helper/test/integration-spec/helper.searchForFacetValues.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js index 7c46aed7eb..8be5f3fff7 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.searchForFacetValues.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.searchOnce.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js similarity index 97% rename from packages/algoliasearch-helper/test/integration-spec/helper.searchOnce.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js index 3e4f115ea4..e7355f6560 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.searchOnce.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/integration-spec/helper.tags.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js similarity index 97% rename from packages/algoliasearch-helper/test/integration-spec/helper.tags.js rename to packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js index 6968754435..7bce418177 100644 --- a/packages/algoliasearch-helper/test/integration-spec/helper.tags.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js @@ -1,6 +1,6 @@ 'use strict'; -var utils = require('../integration-utils'); +var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/RefinementList/clear.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/RefinementList/clear.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/RefinementList/clear.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/RefinementList/clear.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/_clearNumericRefinements.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/_clearNumericRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/_clearNumericRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/_clearNumericRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/_parseNumbers.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/_parseNumbers.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/_parseNumbers.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/_parseNumbers.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/constructorFn.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/constructorFn.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/constructorFn.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/constructorFn.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/getConjunctiveRefinements.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/getConjunctiveRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/getConjunctiveRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/getConjunctiveRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/getDisjunctiveRefinements.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/getDisjunctiveRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/getDisjunctiveRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/getDisjunctiveRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/getExcludeRefinements.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/getExcludeRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/getExcludeRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/getExcludeRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/hierarchical-facets/add.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/hierarchical-facets/add.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/hierarchical-facets/add.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/hierarchical-facets/add.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/hierarchical-facets/remove.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/hierarchical-facets/remove.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/hierarchical-facets/remove.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/hierarchical-facets/remove.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/isDisjunctiveFacetRefined.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/isDisjunctiveFacetRefined.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/isDisjunctiveFacetRefined.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/isDisjunctiveFacetRefined.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/isExcludeRefined.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/isExcludeRefined.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/isExcludeRefined.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/isExcludeRefined.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/isFacetRefined.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/isFacetRefined.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/isFacetRefined.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/isFacetRefined.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/isHierarchicalFacetRefined.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/isHierarchicalFacetRefined.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/isHierarchicalFacetRefined.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/isHierarchicalFacetRefined.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/isNumericRefined.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/isNumericRefined.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/isNumericRefined.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/isNumericRefined.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/listAttributes.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/listAttributes.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/listAttributes.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/listAttributes.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/noChanges.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/noChanges.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/noChanges.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/noChanges.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/numericAttributes.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/numericAttributes.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/numericAttributes.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/numericAttributes.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/numericFilters.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/numericFilters.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/numericFilters.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/numericFilters.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/removeXFacet.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/removeXFacet.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/removeXFacet.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/removeXFacet.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/removeXFacetRefinement.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/removeXFacetRefinement.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/removeXFacetRefinement.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/removeXFacetRefinement.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/resetPage.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/resetPage.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/resetPage.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/resetPage.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/setQueryParameter.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/setQueryParameter.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/setQueryParameter.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/setQueryParameter.js diff --git a/packages/algoliasearch-helper/test/spec/SearchParameters/setQueryParameters.js b/packages/algoliasearch-helper/__tests__/spec/SearchParameters/setQueryParameters.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchParameters/setQueryParameters.js rename to packages/algoliasearch-helper/__tests__/spec/SearchParameters/setQueryParameters.js diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacet.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js similarity index 84% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacet.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js index 7672523f70..597bd9070b 100644 --- a/packages/algoliasearch-helper/test/spec/SearchResults/getFacet.js +++ b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js @@ -3,7 +3,7 @@ var SearchResults = require('../../../src/SearchResults'); test('getFacetByName should return a given facet be it disjunctive or conjunctive', function () { - var data = require('../../datasets/SearchParameters/search.dataset')(); + var data = require('../../../test/datasets/SearchParameters/search.dataset')(); var result = new SearchResults(data.searchParams, data.response.results); diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetStats.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetStats.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetStats.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetStats.js diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues-facetOrdering.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues-facetOrdering.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues-facetOrdering.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues-facetOrdering.js diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues.js diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/conjunctive.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/conjunctive.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/conjunctive.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/conjunctive.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/disjunctive.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/disjunctive.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/disjunctive.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/disjunctive.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/hierarchical.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/hierarchical.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/hierarchical.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/hierarchical.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/noFilters.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/noFilters.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/noFilters.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/noFilters.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/sparse.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/sparse.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getFacetValues/sparse.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacetValues/sparse.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/conjunctive-brand-apple.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/conjunctive-brand-apple.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/conjunctive-brand-apple.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/conjunctive-brand-apple.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/disjunctive-type-trendcase.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/disjunctive-type-trendcase.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/disjunctive-type-trendcase.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/disjunctive-type-trendcase.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/dummy-tags.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/dummy-tags.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/dummy-tags.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/dummy-tags.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/exclude-apple.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/exclude-apple.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/exclude-apple.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/exclude-apple.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/exclude-artificial-results.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/exclude-artificial-results.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/exclude-artificial-results.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/exclude-artificial-results.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/hierarchical-cards.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/hierarchical-cards.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/hierarchical-cards.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/hierarchical-cards.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/noFilters.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/noFilters.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/noFilters.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/noFilters.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/numeric-rating-3.json b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/numeric-rating-3.json similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/getRefinements/numeric-rating-3.json rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/getRefinements/numeric-rating-3.json diff --git a/packages/algoliasearch-helper/test/spec/SearchResults/initialization.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/initialization.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/SearchResults/initialization.js rename to packages/algoliasearch-helper/__tests__/spec/SearchResults/initialization.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/addFacetRefinement.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/addFacetRefinement.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/addFacetRefinement.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/addFacetRefinement.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/clears.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/clears.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/clears.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/clears.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/client.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/client.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/client.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/client.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/constructor.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/constructor.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/constructor.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/constructor.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/detach.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/detach.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/detach.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/detach.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/empty-index.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/empty-index.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/empty-index.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/empty-index.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/events.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/events.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/events.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/events.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/multiqueries.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/multiqueries.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/derive/multiqueries.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/derive/multiqueries.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/distinct.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/distinct.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/distinct.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/distinct.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/events.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/events.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/events.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/events.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/excludes.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/excludes.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/excludes.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/excludes.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/facetFilters.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/facetFilters.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/facetFilters.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/facetFilters.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/findAnswers.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/findAnswers.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/findAnswers.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/findAnswers.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/getNumericRefinement.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/getNumericRefinement.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/getNumericRefinement.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/getNumericRefinement.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/getQuery.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/getQuery.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/getQuery.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/getQuery.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/hasRefinements.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/hasRefinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/hasRefinements.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/hasRefinements.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/incorrectFacetDefinition.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/incorrectFacetDefinition.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/incorrectFacetDefinition.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/incorrectFacetDefinition.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/numericFilters.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/numericFilters.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/numericFilters.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/numericFilters.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/pages.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pages.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/pages.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pages.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/pendingSearch.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js similarity index 93% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/pendingSearch.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js index b6fdab9bc6..f8e1de930a 100644 --- a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/pendingSearch.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js @@ -5,7 +5,7 @@ var algoliaSearch = require('algoliasearch'); var algoliasearchHelper = require('../../../index'); test('When searchOnce with callback, hasPendingRequests is true', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -38,7 +38,7 @@ test('When searchOnce with callback, hasPendingRequests is true', function (done }); test('When searchOnce with promises, hasPendingRequests is true', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -109,7 +109,7 @@ test('When searchForFacetValues, hasPendingRequests is true', function (done) { }); test('When helper.search(), hasPendingRequests is true', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -144,7 +144,7 @@ test('When helper.search(), hasPendingRequests is true', function (done) { }); test('When helper.search() and one request is discarded, hasPendingRequests is true unless all come back', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCbs = []; diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/queryID.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js similarity index 96% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/queryID.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js index 80fcbd5067..639eecfc0e 100644 --- a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/queryID.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js @@ -22,7 +22,7 @@ test('the queryid should keep increasing when new requests arrives', function () }); test('the response handler should check that the query is not outdated', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var shouldTriggerResult = true; var callCount = 0; diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/searchForFacetValues.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchForFacetValues.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/searchForFacetValues.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchForFacetValues.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/searchOnce.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js similarity index 97% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/searchOnce.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js index 2481cd5591..6a6034c6a1 100644 --- a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/searchOnce.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js @@ -5,7 +5,7 @@ var SearchParameters = require('../../../src/SearchParameters'); var algoliasearchHelper = require('../../../index'); test('searchOnce should call the algolia client according to the number of refinements and call callback with no error and with results when no error', function (done) { - var testData = require('../../datasets/SearchParameters/search.dataset')(); + var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () { diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/setQueryParameter.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/setQueryParameter.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/setQueryParameter.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/setQueryParameter.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/state.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/state.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/state.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/state.js diff --git a/packages/algoliasearch-helper/test/spec/algoliasearch.helper/tags.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/tags.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/algoliasearch.helper/tags.js rename to packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/tags.js diff --git a/packages/algoliasearch-helper/test/spec/functions/compact.js b/packages/algoliasearch-helper/__tests__/spec/functions/compact.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/compact.js rename to packages/algoliasearch-helper/__tests__/spec/functions/compact.js diff --git a/packages/algoliasearch-helper/test/spec/functions/defaultsPure.js b/packages/algoliasearch-helper/__tests__/spec/functions/defaultsPure.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/defaultsPure.js rename to packages/algoliasearch-helper/__tests__/spec/functions/defaultsPure.js diff --git a/packages/algoliasearch-helper/test/spec/functions/find.js b/packages/algoliasearch-helper/__tests__/spec/functions/find.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/find.js rename to packages/algoliasearch-helper/__tests__/spec/functions/find.js diff --git a/packages/algoliasearch-helper/test/spec/functions/findIndex.js b/packages/algoliasearch-helper/__tests__/spec/functions/findIndex.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/findIndex.js rename to packages/algoliasearch-helper/__tests__/spec/functions/findIndex.js diff --git a/packages/algoliasearch-helper/test/spec/functions/formatSort.js b/packages/algoliasearch-helper/__tests__/spec/functions/formatSort.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/formatSort.js rename to packages/algoliasearch-helper/__tests__/spec/functions/formatSort.js diff --git a/packages/algoliasearch-helper/test/spec/functions/intersection.js b/packages/algoliasearch-helper/__tests__/spec/functions/intersection.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/intersection.js rename to packages/algoliasearch-helper/__tests__/spec/functions/intersection.js diff --git a/packages/algoliasearch-helper/test/spec/functions/merge.js b/packages/algoliasearch-helper/__tests__/spec/functions/merge.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/merge.js rename to packages/algoliasearch-helper/__tests__/spec/functions/merge.js diff --git a/packages/algoliasearch-helper/test/spec/functions/orderBy.js b/packages/algoliasearch-helper/__tests__/spec/functions/orderBy.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/orderBy.js rename to packages/algoliasearch-helper/__tests__/spec/functions/orderBy.js diff --git a/packages/algoliasearch-helper/test/spec/functions/valToNumber.js b/packages/algoliasearch-helper/__tests__/spec/functions/valToNumber.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/functions/valToNumber.js rename to packages/algoliasearch-helper/__tests__/spec/functions/valToNumber.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/add-remove.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/add-remove.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/add-remove.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/add-remove.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/attributes-order.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/attributes-order.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/attributes-order.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/attributes-order.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/breadcrumb.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/breadcrumb.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/breadcrumb.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/breadcrumb.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/custom-prefix-path.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/custom-prefix-path.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/custom-prefix-path.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/custom-prefix-path.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/custom-separator.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/custom-separator.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/custom-separator.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/custom-separator.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/do-not-show-parent-level.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/do-not-show-parent-level.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/do-not-show-parent-level.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/do-not-show-parent-level.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/facet-value-length.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/facet-value-length.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/facet-value-length.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/facet-value-length.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/getFacetValues.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/getFacetValues.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/getFacetValues.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/getFacetValues.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/no-refinement.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/no-refinement.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/no-refinement.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/no-refinement.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/no-trim.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/no-trim.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/no-trim.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/no-trim.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/objects-with-multiple-categories.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/objects-with-multiple-categories.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/objects-with-multiple-categories.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/objects-with-multiple-categories.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/one-level.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/one-level.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/one-level.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/one-level.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/pagination.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/pagination.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/pagination.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/pagination.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/parent-toggleRefine.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/parent-toggleRefine.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/parent-toggleRefine.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/parent-toggleRefine.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/refined-no-result.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/refined-no-result.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/refined-no-result.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/refined-no-result.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/show-parent-level.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/show-parent-level.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/show-parent-level.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/show-parent-level.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/simple-usage.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/simple-usage.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/simple-usage.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/simple-usage.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/sort-by.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/sort-by.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/sort-by.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/sort-by.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/two-facets.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/two-facets.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/two-facets.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/two-facets.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/unknown-facet.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/unknown-facet.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/unknown-facet.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/unknown-facet.js diff --git a/packages/algoliasearch-helper/test/spec/hierarchical-facets/with-a-disjunctive-facet.js b/packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/with-a-disjunctive-facet.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/hierarchical-facets/with-a-disjunctive-facet.js rename to packages/algoliasearch-helper/__tests__/spec/hierarchical-facets/with-a-disjunctive-facet.js diff --git a/packages/algoliasearch-helper/test/spec/refinements.js b/packages/algoliasearch-helper/__tests__/spec/refinements.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/refinements.js rename to packages/algoliasearch-helper/__tests__/spec/refinements.js diff --git a/packages/algoliasearch-helper/test/spec/requestBuilder.js b/packages/algoliasearch-helper/__tests__/spec/requestBuilder.js similarity index 95% rename from packages/algoliasearch-helper/test/spec/requestBuilder.js rename to packages/algoliasearch-helper/__tests__/spec/requestBuilder.js index 42f94ae76a..aa54360ac7 100644 --- a/packages/algoliasearch-helper/test/spec/requestBuilder.js +++ b/packages/algoliasearch-helper/__tests__/spec/requestBuilder.js @@ -5,7 +5,8 @@ var SearchParameters = require('../../src/SearchParameters'); var getQueries = requestBuilder._getQueries; test('The request builder should set analytics to subsequent queries', function () { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var searchParams = testData.searchParams; searchParams.analytics = true; @@ -17,7 +18,8 @@ test('The request builder should set analytics to subsequent queries', function }); test('The request builder should set clickAnalytics to subsequent queries', function () { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var searchParams = testData.searchParams; searchParams.clickAnalytics = true; @@ -29,7 +31,8 @@ test('The request builder should set clickAnalytics to subsequent queries', func }); test('The request builder should should force analytics to false on subsequent queries if not specified', function () { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var searchParams = testData.searchParams; var queries = getQueries(searchParams.index, searchParams); @@ -39,7 +42,8 @@ test('The request builder should should force analytics to false on subsequent q }); test('The request builder should should force clickAnalytics to false on subsequent queries if not specified', function () { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var searchParams = testData.searchParams; var queries = getQueries(searchParams.index, searchParams); diff --git a/packages/algoliasearch-helper/test/spec/search.js b/packages/algoliasearch-helper/__tests__/spec/search.js similarity index 95% rename from packages/algoliasearch-helper/test/spec/search.js rename to packages/algoliasearch-helper/__tests__/spec/search.js index 535f0df87a..e054d1001d 100644 --- a/packages/algoliasearch-helper/test/spec/search.js +++ b/packages/algoliasearch-helper/__tests__/spec/search.js @@ -3,7 +3,7 @@ var algoliasearchHelper = require('../../index'); test('Search should call the algolia client according to the number of refinements', function (done) { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = require('../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () { @@ -90,7 +90,7 @@ test('Search should call the algolia client according to the number of refinemen }); test('Search should not mutate the original client response', function (done) { - var testData = require('../datasets/SearchParameters/search.dataset')(); + var testData = require('../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () { diff --git a/packages/algoliasearch-helper/test/spec/utils/isValidUserToken.js b/packages/algoliasearch-helper/__tests__/spec/utils/isValidUserToken.js similarity index 100% rename from packages/algoliasearch-helper/test/spec/utils/isValidUserToken.js rename to packages/algoliasearch-helper/__tests__/spec/utils/isValidUserToken.js diff --git a/packages/algoliasearch-helper/jest.setup.js b/packages/algoliasearch-helper/jest.setup.js deleted file mode 100644 index 26cf8e5a2c..0000000000 --- a/packages/algoliasearch-helper/jest.setup.js +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-env jest */ - -'use strict'; - -jest.setTimeout(20000); diff --git a/packages/algoliasearch-helper/test/integration-utils.js b/packages/algoliasearch-helper/test/integration-utils.js index e6dd4b7ce4..e34f6db772 100644 --- a/packages/algoliasearch-helper/test/integration-utils.js +++ b/packages/algoliasearch-helper/test/integration-utils.js @@ -6,6 +6,13 @@ function setup(indexName, fn) { var appID = process.env.INTEGRATION_TEST_APPID; var key = process.env.INTEGRATION_TEST_API_KEY; + if (!appID) { + throw new Error('Missing environment variable INTEGRATION_TEST_APPID'); + } + if (!key) { + throw new Error('Missing environment variable INTEGRATION_TEST_API_KEY'); + } + var client = algoliasearch(appID, key, { // all indexing requests must be done in https protocol: 'https:', diff --git a/packages/algoliasearch-helper/test/run.js b/packages/algoliasearch-helper/test/run.js deleted file mode 100644 index 2810e779d4..0000000000 --- a/packages/algoliasearch-helper/test/run.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -var path = require('path'); -var jest = require('jest'); -var algoliasearch = require('algoliasearch'); -var staticJestConfig = require('../jest.config'); - -var enableIntegrationTest = - process.env.ONLY_UNIT !== 'true' && - process.env.INTEGRATION_TEST_API_KEY && - process.env.INTEGRATION_TEST_APPID; - -var projectsRootPaths = [path.resolve(__dirname, '..')]; -var dynamicJestConfig = Object.assign({}, staticJestConfig, { - maxWorkers: 4, - setupFilesAfterEnv: staticJestConfig.setupFilesAfterEnv || [], -}); - -if (enableIntegrationTest) { - dynamicJestConfig.testMatch.push( - '/test/integration-spec/**/*.[jt]s?(x)' - ); - dynamicJestConfig.setupFilesAfterEnv.push( - path.resolve(__dirname, '..', 'jest.setup.js') - ); -} - -jest.runCLI(dynamicJestConfig, projectsRootPaths).then(function (response) { - if (!response.results.success) { - process.exitCode = response.globalConfig.testFailureExitCode; - } - - if (enableIntegrationTest) { - var client = algoliasearch( - process.env.INTEGRATION_TEST_APPID, - process.env.INTEGRATION_TEST_API_KEY - ); - client.deleteIndex = - client.deleteIndex || - function (deleteIndexName) { - return client.initIndex(deleteIndexName).delete(); - }; - client.listIndexes = client.listIndexes || client.listIndices; - - client.listIndexes().then((content) => { - content.items - .map((i) => i.name) - .filter((n) => n.indexOf('_circle-algoliasearch-helper') !== -1) - .forEach((n) => client.deleteIndex(n)); - }); - } -}); diff --git a/tests/utils/setupTests.ts b/tests/utils/setupTests.ts index fae3f1e249..c6cb4b0bdf 100644 --- a/tests/utils/setupTests.ts +++ b/tests/utils/setupTests.ts @@ -33,3 +33,12 @@ beforeEach(() => { if (isVue2) { Vue2.config.productionTip = false; } + +const enableIntegrationTest = + process.env.ONLY_UNIT !== 'true' && + process.env.INTEGRATION_TEST_API_KEY && + process.env.INTEGRATION_TEST_APPID; + +if (enableIntegrationTest) { + jest.setTimeout(20_000); +} diff --git a/tests/utils/teardownTests.ts b/tests/utils/teardownTests.ts new file mode 100644 index 0000000000..5f5993d97d --- /dev/null +++ b/tests/utils/teardownTests.ts @@ -0,0 +1,34 @@ +import algoliasearch from 'algoliasearch'; + +export default async function cleanup() { + const enableIntegrationTest = + process.env.ONLY_UNIT !== 'true' && + process.env.INTEGRATION_TEST_API_KEY && + process.env.INTEGRATION_TEST_APPID; + + if (enableIntegrationTest) { + // eslint-disable-next-line no-console + console.log('Cleaning up integration tests'); + + const client = algoliasearch( + process.env.INTEGRATION_TEST_APPID!, + process.env.INTEGRATION_TEST_API_KEY! + ); + + const deleteIndex = function deleteIndex(indexName: string) { + if ((client as any).deleteIndex) + return (client as any).deleteIndex(indexName); + return client.initIndex(indexName).delete(); + }; + + (client as any).listIndices = + client.listIndices || (client as any).listIndexes; + + await client.listIndices().then((content) => { + content.items + .map((i) => i.name) + .filter((n) => n.indexOf('_circle-algoliasearch-helper') !== -1) + .forEach((n) => deleteIndex(n)); + }); + } +} From dddfe1792c22a4c0482d8e502bfd5ca6b9de0a9e Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 20 Jul 2023 15:10:46 +0200 Subject: [PATCH 2/6] correct filter --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 31d37416c0..7c6b23836c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,7 +22,7 @@ const config = { '/packages/react-instantsearch-hooks-router-nextjs', '/__utils__/', enableIntegrationTest ? '' : '/integration-spec/', - ], + ].filter(Boolean), watchPathIgnorePatterns: [ '/packages/*/cjs', '/packages/*/dist', From fb3e751bdfc810cada6c2e4378bc876f146d7db3 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 20 Jul 2023 15:11:01 +0200 Subject: [PATCH 3/6] retry using jest (works in this case) --- .../__tests__/integration-spec/helper.derive.js | 2 ++ .../__tests__/integration-spec/helper.distinct.facet.js | 2 ++ .../__tests__/integration-spec/helper.filters.js | 2 ++ .../__tests__/integration-spec/helper.geo.js | 2 ++ .../__tests__/integration-spec/helper.highlight.js | 2 ++ .../__tests__/integration-spec/helper.insights.js | 2 ++ .../__tests__/integration-spec/helper.numerics.js | 2 ++ .../__tests__/integration-spec/helper.results.getFacetValues.js | 2 ++ .../__tests__/integration-spec/helper.searchForFacetValues.js | 2 ++ .../__tests__/integration-spec/helper.searchOnce.js | 2 ++ .../__tests__/integration-spec/helper.tags.js | 2 ++ 11 files changed, 22 insertions(+) diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js index 89876ba44f..5133a192c2 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.derive.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js index 4930bc3dc9..28fee7508d 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.distinct.facet.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js index 6038e421cf..c7e6f2ecd0 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.filters.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js index ea83a84f17..9a40a3f23c 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.geo.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js index 32894764f5..91e121aa53 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.highlight.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js index 4756055228..defb9bf1ca 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.insights.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js index 2efb6919f2..6ef883045a 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.numerics.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js index f71ed69c78..8eb2cecb07 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.results.getFacetValues.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js index 8be5f3fff7..7bd577cc6a 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchForFacetValues.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js index e7355f6560..b0c1e83e0d 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.searchOnce.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; diff --git a/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js b/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js index 7bce418177..4c4cbfb531 100644 --- a/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js +++ b/packages/algoliasearch-helper/__tests__/integration-spec/helper.tags.js @@ -1,5 +1,7 @@ 'use strict'; +jest.retryTimes(3, { logErrorsBeforeRetry: true }); + var utils = require('../../test/integration-utils'); var setup = utils.setupSimple; var createIndexName = utils.createIndexName; From 5a065bc08f5d9915ebb46dd2365cdee041dae98d Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 20 Jul 2023 16:21:02 +0200 Subject: [PATCH 4/6] remove stale config --- packages/algoliasearch-helper/jest.config.js | 10 ---------- packages/algoliasearch-helper/package.json | 4 ---- packages/algoliasearch-helper/scripts/test.sh | 11 ----------- 3 files changed, 25 deletions(-) delete mode 100644 packages/algoliasearch-helper/jest.config.js delete mode 100755 packages/algoliasearch-helper/scripts/test.sh diff --git a/packages/algoliasearch-helper/jest.config.js b/packages/algoliasearch-helper/jest.config.js deleted file mode 100644 index 9e932a4e9d..0000000000 --- a/packages/algoliasearch-helper/jest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = { - testEnvironment: 'node', - testMatch: ['/test/spec/**/*.[jt]s?(x)'], - watchPlugins: [ - 'jest-watch-typeahead/filename', - 'jest-watch-typeahead/testname', - ], -}; diff --git a/packages/algoliasearch-helper/package.json b/packages/algoliasearch-helper/package.json index c384da9af9..a5f6c2f294 100644 --- a/packages/algoliasearch-helper/package.json +++ b/packages/algoliasearch-helper/package.json @@ -9,10 +9,6 @@ "build": "./scripts/build.sh", "lint": "eslint .", "doc": "node documentation-src/metalsmith.js", - "test": "../../scripts/retry.sh 3 'scripts/test.sh'", - "test:unit": "jest", - "test:watch": "jest --watch", - "test:v3": "yarn run test", "version": "./scripts/update-version.js" }, "author": { diff --git a/packages/algoliasearch-helper/scripts/test.sh b/packages/algoliasearch-helper/scripts/test.sh deleted file mode 100755 index 01bd948cb3..0000000000 --- a/packages/algoliasearch-helper/scripts/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e # exit when error - -[ -z $CIRCLE_BUILD_NUM ] && CI='false' || CI='true' - -if [ $CI == 'true' ]; then - set -x # debug messages -fi - -node test/run.js From 902995c37ab9d108d4f053937474b53362ab1619 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 20 Jul 2023 16:21:07 +0200 Subject: [PATCH 5/6] run all tests for v3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5e4d71ac8..2720d3aac3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "test:e2e": "yarn test:e2e:local", "test:e2e:local": "wdio scripts/wdio/local.conf.js", "test:e2e:saucelabs": "wdio scripts/wdio/saucelabs.conf.js", - "test:v3": "lerna run test:v3", + "test:v3": "./scripts/retry.sh 3 'jest --maxWorkers=4 --ci' && lerna run test:v3 --concurrency=1", "release": "shipjs prepare", "prepare": "lerna run prepare && patch-package", "prepare-vue3": "./scripts/prepare-vue3.js" From fd99b4008761c1c957239d756ecd41454e5a9fc4 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 20 Jul 2023 16:34:00 +0200 Subject: [PATCH 6/6] prettier --- .../__tests__/spec/SearchResults/getFacet.js | 3 ++- .../spec/algoliasearch.helper/pendingSearch.js | 12 ++++++++---- .../__tests__/spec/algoliasearch.helper/queryID.js | 3 ++- .../spec/algoliasearch.helper/searchOnce.js | 3 ++- .../algoliasearch-helper/__tests__/spec/search.js | 6 ++++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js index 597bd9070b..7aa6088027 100644 --- a/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js +++ b/packages/algoliasearch-helper/__tests__/spec/SearchResults/getFacet.js @@ -3,7 +3,8 @@ var SearchResults = require('../../../src/SearchResults'); test('getFacetByName should return a given facet be it disjunctive or conjunctive', function () { - var data = require('../../../test/datasets/SearchParameters/search.dataset')(); + var data = + require('../../../test/datasets/SearchParameters/search.dataset')(); var result = new SearchResults(data.searchParams, data.response.results); diff --git a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js index f8e1de930a..db187e935b 100644 --- a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/pendingSearch.js @@ -5,7 +5,8 @@ var algoliaSearch = require('algoliasearch'); var algoliasearchHelper = require('../../../index'); test('When searchOnce with callback, hasPendingRequests is true', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -38,7 +39,8 @@ test('When searchOnce with callback, hasPendingRequests is true', function (done }); test('When searchOnce with promises, hasPendingRequests is true', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -109,7 +111,8 @@ test('When searchForFacetValues, hasPendingRequests is true', function (done) { }); test('When helper.search(), hasPendingRequests is true', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCb; @@ -144,7 +147,8 @@ test('When helper.search(), hasPendingRequests is true', function (done) { }); test('When helper.search() and one request is discarded, hasPendingRequests is true unless all come back', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var client = algoliaSearch('dsf', 'dsfdf'); var triggerCbs = []; diff --git a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js index 639eecfc0e..8c5ad491b0 100644 --- a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/queryID.js @@ -22,7 +22,8 @@ test('the queryid should keep increasing when new requests arrives', function () }); test('the response handler should check that the query is not outdated', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var shouldTriggerResult = true; var callCount = 0; diff --git a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js index 6a6034c6a1..cfe4f5429a 100644 --- a/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js +++ b/packages/algoliasearch-helper/__tests__/spec/algoliasearch.helper/searchOnce.js @@ -5,7 +5,8 @@ var SearchParameters = require('../../../src/SearchParameters'); var algoliasearchHelper = require('../../../index'); test('searchOnce should call the algolia client according to the number of refinements and call callback with no error and with results when no error', function (done) { - var testData = require('../../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () { diff --git a/packages/algoliasearch-helper/__tests__/spec/search.js b/packages/algoliasearch-helper/__tests__/spec/search.js index e054d1001d..1b2f626e79 100644 --- a/packages/algoliasearch-helper/__tests__/spec/search.js +++ b/packages/algoliasearch-helper/__tests__/spec/search.js @@ -3,7 +3,8 @@ var algoliasearchHelper = require('../../index'); test('Search should call the algolia client according to the number of refinements', function (done) { - var testData = require('../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () { @@ -90,7 +91,8 @@ test('Search should call the algolia client according to the number of refinemen }); test('Search should not mutate the original client response', function (done) { - var testData = require('../../test/datasets/SearchParameters/search.dataset')(); + var testData = + require('../../test/datasets/SearchParameters/search.dataset')(); var client = { search: jest.fn().mockImplementationOnce(function () {