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 [ + [