diff --git a/jest.config.js b/jest.config.js
index b35a492dde..840b76a755 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -25,7 +25,9 @@ module.exports = {
globals: {
__DEV__: true,
},
-
+ snapshotFormat: {
+ printBasicPrototype: false,
+ },
// reporter for circleci
reporters: [
'default',
diff --git a/package.json b/package.json
index 365ea5c26d..133a514d7f 100644
--- a/package.json
+++ b/package.json
@@ -80,8 +80,7 @@
"@testing-library/preact": "1.0.2",
"@types/classnames": "^2.2.7",
"@types/enzyme": "^3.1.15",
- "@types/jest": "^26.0.22",
- "@types/jest-diff": "^24.3.0",
+ "@types/jest": "^27.0.1",
"@types/jsdom": "^16.2.13",
"@types/scriptjs": "^0.0.2",
"@types/storybook__addon-actions": "^3.4.2",
@@ -98,7 +97,7 @@
"algoliasearch": "4.10.3",
"algoliasearch-v3": "npm:algoliasearch@3.35.1",
"babel-eslint": "10.0.3",
- "babel-jest": "26.6.3",
+ "babel-jest": "27.1.0",
"babel-loader": "8.0.6",
"babel-plugin-inline-replace-variables": "1.3.1",
"babel-plugin-polyfill-es-shims": "0.0.7",
@@ -120,12 +119,12 @@
"eslint-plugin-react": "7.18.0",
"eslint-plugin-react-hooks": "2.3.0",
"instantsearch-e2e-tests": "algolia/instantsearch-e2e-tests#1.3.0",
- "jest": "26.6.3",
- "jest-diff": "26.6.2",
- "jest-environment-jsdom": "26.6.2",
+ "jest": "27.1.0",
+ "jest-diff": "27.1.0",
+ "jest-environment-jsdom": "27.1.0",
"jest-environment-jsdom-global": "2.0.4",
"jest-junit": "12.2.0",
- "jest-watch-typeahead": "0.6.2",
+ "jest-watch-typeahead": "0.6.4",
"jscodeshift": "0.7.0",
"jsdom-global": "3.0.2",
"places.js": "1.17.1",
diff --git a/scripts/jest/matchers/toWarnDev.ts b/scripts/jest/matchers/toWarnDev.ts
index c5dd72bf0f..739fa527da 100644
--- a/scripts/jest/matchers/toWarnDev.ts
+++ b/scripts/jest/matchers/toWarnDev.ts
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
-import jestDiff from 'jest-diff';
+import { diff } from 'jest-diff';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
@@ -56,7 +56,7 @@ const matcher: jest.ExpectExtendMap = {
Difference:
-${jestDiff(expectedMessage, actualWarning)}`,
+${diff(expectedMessage, actualWarning)}`,
};
}
diff --git a/src/__tests__/index-es-test.ts b/src/__tests__/index-es-test.ts
index f11abea482..16127c057e 100644
--- a/src/__tests__/index-es-test.ts
+++ b/src/__tests__/index-es-test.ts
@@ -31,7 +31,7 @@ describe('instantsearch()', () => {
it('includes the helper functions', () => {
expect(Object.keys(instantsearch)).toMatchInlineSnapshot(`
- Array [
+ [
"version",
"createInfiniteHitsSessionStorageCache",
"highlight",
diff --git a/src/__tests__/index-test.ts b/src/__tests__/index-test.ts
index 91ef76077b..5a16a04b1f 100644
--- a/src/__tests__/index-test.ts
+++ b/src/__tests__/index-test.ts
@@ -21,7 +21,7 @@ describe('instantsearch()', () => {
it('includes the API and the helper functions', () => {
expect(Object.keys(instantsearch)).toMatchInlineSnapshot(`
- Array [
+ [
"version",
"connectors",
"widgets",
diff --git a/src/components/ClearRefinements/__tests__/__snapshots__/ClearRefinements-test.tsx.snap b/src/components/ClearRefinements/__tests__/__snapshots__/ClearRefinements-test.tsx.snap
index 22e03d4010..0b16d58f41 100644
--- a/src/components/ClearRefinements/__tests__/__snapshots__/ClearRefinements-test.tsx.snap
+++ b/src/components/ClearRefinements/__tests__/__snapshots__/ClearRefinements-test.tsx.snap
@@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ClearRefinements should render 1`] = `
-Array [
+[
- Array [
+ [
with a specific class when no refinements 1`] = `
-Array [
+[
- Array [
+ [
1`] = `
-Array [
+[
- Array [
+ [
,
]
- Array [
+ [
without highlight function 1`] = `
-Array [
+[
- Array [
+ [
- name 1",
}
}
/>,
]
- Array [
+ [
- name 2",
}
}
diff --git a/src/components/MenuSelect/__tests__/__snapshots__/MenuSelect-test.tsx.snap b/src/components/MenuSelect/__tests__/__snapshots__/MenuSelect-test.tsx.snap
index dc591e2ede..ac088250bd 100644
--- a/src/components/MenuSelect/__tests__/__snapshots__/MenuSelect-test.tsx.snap
+++ b/src/components/MenuSelect/__tests__/__snapshots__/MenuSelect-test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MenuSelect should render with custom templates 1`] = `
-Array [
+[
@@ -10,33 +10,33 @@ Array [
onChange={[Function]}
value=""
>
- Array [
+ [
,
]
- Array [
+ [
,
]
- Array [
+ [
with items 1`] = `
-Array [
+[
@@ -58,33 +58,33 @@ Array [
onChange={[Function]}
value=""
>
- Array [
+ [
,
]
- Array [
+ [
,
]
- Array [
+ [
with no items 1`] = `
-Array [
+[
@@ -106,11 +106,11 @@ Array [
onChange={[Function]}
value=""
>
- Array [
+ [
@@ -264,22 +264,22 @@ exports[`RangeInput willReceiveProps expect to update the empty state from given
/>
@@ -344,22 +344,22 @@ exports[`RangeInput willReceiveProps expect to update the empty state from given
/>
@@ -424,22 +424,22 @@ exports[`RangeInput willReceiveProps expect to update the state from given props
/>
@@ -504,22 +504,22 @@ exports[`RangeInput willReceiveProps expect to update the state from given props
/>
diff --git a/src/components/RefinementList/__tests__/__snapshots__/RefinementListItem-test.tsx.snap b/src/components/RefinementList/__tests__/__snapshots__/RefinementListItem-test.tsx.snap
index 5bcaea1db4..ce9ed4b92d 100644
--- a/src/components/RefinementList/__tests__/__snapshots__/RefinementListItem-test.tsx.snap
+++ b/src/components/RefinementList/__tests__/__snapshots__/RefinementListItem-test.tsx.snap
@@ -7,16 +7,16 @@ exports[`RefinementListItem renders an item 1`] = `
>
diff --git a/src/components/SearchBox/__tests__/__snapshots__/SearchBox-test.tsx.snap b/src/components/SearchBox/__tests__/__snapshots__/SearchBox-test.tsx.snap
index e60c45c56b..aa2530e52b 100644
--- a/src/components/SearchBox/__tests__/__snapshots__/SearchBox-test.tsx.snap
+++ b/src/components/SearchBox/__tests__/__snapshots__/SearchBox-test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SearchBox Rendering with custom templates 1`] = `
-Array [
+[
@@ -29,11 +29,11 @@ Array [
type="search"
value=""
/>
- Array [
+ [
,
]
- Array [
+ [
,
]
- Array [
+ [
@@ -100,11 +100,11 @@ Array [
type="search"
value=""
/>
- Array [
+ [
,
]
- Array [
+ [
,
]
- Array [
+ [
with numbers 1`] = `
-Array [
+[
with strings 1`] = `
-Array [
+[