diff --git a/package.json b/package.json index ba87d9b..fdc1ae7 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,9 @@ "src", "node_modules" ], - "setupTestFrameworkScriptFile": "/jest/setup.js", + "setupFilesAfterEnv": [ + "/jest/setup.js" + ], "snapshotSerializers": [ "enzyme-to-json/serializer" ], @@ -79,9 +81,10 @@ "@babel/core": "^7.2.2", "@ungap/url-search-params": "^0.1.2", "babel-core": "^7.0.0-bridge.0", - "babel-jest": "^23.6.0", + "babel-jest": "^24.5.0", "babel-plugin-dynamic-import-node": "^2.2.0", "babel-preset-gatsby": "^0.1.6", + "core-js": "2", "enzyme": "^3.8.0", "enzyme-adapter-react-16": "^1.7.1", "enzyme-to-json": "^3.3.5", @@ -97,11 +100,11 @@ "gatsby-plugin-react-helmet": "^3.0.5", "gatsby-plugin-sentry": "^1.0.0", "husky": "^1.3.1", - "i18next": "^14.0.1", - "i18next-browser-languagedetector": "^2.2.4", - "i18next-xhr-backend": "^1.5.1", + "i18next": "^15.0.7", + "i18next-browser-languagedetector": "^3.0.1", + "i18next-xhr-backend": "^2.0.1", "identity-obj-proxy": "^3.0.0", - "jest": "^23.6.0", + "jest": "^24.5.0", "postcss-cssnext": "^3.1.0", "postcss-import": "^12.0.1", "prop-types": "^15.6.2", @@ -109,7 +112,7 @@ "react-dom": "^16.7.0", "react-feather": "^1.1.5", "react-helmet": "^5.2.0", - "react-i18next": "^9.0.2", + "react-i18next": "^10.5.3", "react-modal": "^3.8.1" } } diff --git a/src/components/App/__snapshots__/test.js.snap b/src/components/App/__snapshots__/test.js.snap index 6304af7..cd1a630 100644 --- a/src/components/App/__snapshots__/test.js.snap +++ b/src/components/App/__snapshots__/test.js.snap @@ -2,7 +2,7 @@ exports[`App removing rendered expression 1`] = ` - - - + + - - - - - + `; exports[`App rendering an expression 3`] = ` - - - + + - - - + + - - - + - - - + `; exports[`App rendering with an invalid syntax 3`] = ` -

- + An error occurred while rendering the regular expression. - +

- + Retry - +
diff --git a/src/components/App/index.js b/src/components/App/index.js index 95c3683..03c7b92 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { withNamespaces, Trans } from 'react-i18next'; +import { withTranslation, Trans } from 'react-i18next'; import * as Sentry from '@sentry/browser'; import URLSearchParams from '@ungap/url-search-params'; @@ -162,4 +162,4 @@ class App extends React.PureComponent { } export { App }; -export default withNamespaces()(App); +export default withTranslation()(App); diff --git a/src/components/Footer/__snapshots__/test.js.snap b/src/components/Footer/__snapshots__/test.js.snap index 3d08cd0..2ede97f 100644 --- a/src/components/Footer/__snapshots__/test.js.snap +++ b/src/components/Footer/__snapshots__/test.js.snap @@ -8,17 +8,17 @@ exports[`Footer rendering 1`] = ` className="list" >
  • - + Created by Jeff Avallone - +
  • - + Generated images licensed: - +
  • - + Display - +
    - + Permalink - + @@ -97,9 +97,9 @@ exports[`FormActions rendering download links with data after mounting 2`] = ` color="currentColor" size="24" /> - + Permalink - + @@ -143,9 +143,9 @@ exports[`FormActions rendering download links with data after mounting 3`] = ` color="currentColor" size="24" /> - + Permalink - + @@ -163,9 +163,9 @@ exports[`FormActions rendering with a permalink 1`] = ` color="currentColor" size="24" /> - + Permalink - + diff --git a/src/components/FormActions/index.js b/src/components/FormActions/index.js index b3b1846..c8dff09 100644 --- a/src/components/FormActions/index.js +++ b/src/components/FormActions/index.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { withNamespaces, Trans } from 'react-i18next'; +import { withTranslation, Trans } from 'react-i18next'; import DownloadIcon from 'react-feather/dist/icons/download'; import LinkIcon from 'react-feather/dist/icons/link'; @@ -94,4 +94,4 @@ class FormActions extends React.PureComponent { } export { FormActions }; -export default withNamespaces()(FormActions); +export default withTranslation()(FormActions); diff --git a/src/components/Header/__snapshots__/test.js.snap b/src/components/Header/__snapshots__/test.js.snap index e9d2324..6838977 100644 --- a/src/components/Header/__snapshots__/test.js.snap +++ b/src/components/Header/__snapshots__/test.js.snap @@ -16,7 +16,7 @@ exports[`Header closing the Privacy Policy modal 1`] = ` shouldFocusAfterRender={true} shouldReturnFocusAfterClose={true} > - @@ -44,9 +44,9 @@ exports[`Header closing the Privacy Policy modal 1`] = ` color="currentColor" size="24" /> - + Source on GitLab - +
  • @@ -54,18 +54,18 @@ exports[`Header closing the Privacy Policy modal 1`] = ` onClick={[Function]} to="/privacy" > - + Privacy Policy - +
  • - +
  • - +
  • @@ -88,7 +88,7 @@ exports[`Header closing the Privacy Policy modal 2`] = ` shouldFocusAfterRender={true} shouldReturnFocusAfterClose={true} > - @@ -116,9 +116,9 @@ exports[`Header closing the Privacy Policy modal 2`] = ` color="currentColor" size="24" /> - + Source on GitLab - +
  • @@ -126,18 +126,18 @@ exports[`Header closing the Privacy Policy modal 2`] = ` onClick={[Function]} to="/privacy" > - + Privacy Policy - +
  • - +
  • - +
  • @@ -160,7 +160,7 @@ exports[`Header opening the Privacy Policy modal 1`] = ` shouldFocusAfterRender={true} shouldReturnFocusAfterClose={true} > - @@ -188,9 +188,9 @@ exports[`Header opening the Privacy Policy modal 1`] = ` color="currentColor" size="24" /> - + Source on GitLab - +
  • @@ -198,18 +198,18 @@ exports[`Header opening the Privacy Policy modal 1`] = ` onClick={[Function]} to="/privacy" > - + Privacy Policy - +
  • - +
  • - +
  • @@ -232,7 +232,7 @@ exports[`Header rendering 1`] = ` shouldFocusAfterRender={true} shouldReturnFocusAfterClose={true} > - @@ -260,9 +260,9 @@ exports[`Header rendering 1`] = ` color="currentColor" size="24" /> - + Source on GitLab - +
  • @@ -270,18 +270,18 @@ exports[`Header rendering 1`] = ` onClick={[Function]} to="/privacy" > - + Privacy Policy - +
  • - +
  • - +
  • @@ -304,7 +304,7 @@ exports[`Header rendering with no banner 1`] = ` shouldFocusAfterRender={true} shouldReturnFocusAfterClose={true} > - @@ -332,9 +332,9 @@ exports[`Header rendering with no banner 1`] = ` color="currentColor" size="24" /> - + Source on GitLab - +
  • @@ -342,18 +342,18 @@ exports[`Header rendering with no banner 1`] = ` onClick={[Function]} to="/privacy" > - + Privacy Policy - +
  • - +
  • - +
  • diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 5d63b3f..5e54d30 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import Modal from 'react-modal'; import { Link } from 'gatsby'; -import { withNamespaces, Trans } from 'react-i18next'; +import { withTranslation, Trans } from 'react-i18next'; import GitlabIcon from 'react-feather/dist/icons/gitlab'; @@ -81,4 +81,4 @@ class Header extends React.PureComponent { } export { Header }; -export default withNamespaces()(Header); +export default withTranslation()(Header); diff --git a/src/components/InstallPrompt/__snapshots__/test.js.snap b/src/components/InstallPrompt/__snapshots__/test.js.snap index 08d3585..1d40561 100644 --- a/src/components/InstallPrompt/__snapshots__/test.js.snap +++ b/src/components/InstallPrompt/__snapshots__/test.js.snap @@ -9,8 +9,8 @@ exports[`InstallPrompt rendering after an install prompt has been requested 2`] href="#install" onClick={[Function]} > - + Add to Home Screen - + `; diff --git a/src/components/InstallPrompt/index.js b/src/components/InstallPrompt/index.js index 261c188..43f263a 100644 --- a/src/components/InstallPrompt/index.js +++ b/src/components/InstallPrompt/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { withNamespaces, Trans } from 'react-i18next'; +import { withTranslation, Trans } from 'react-i18next'; class InstallPrompt extends React.PureComponent { state = { @@ -50,4 +50,4 @@ class InstallPrompt extends React.PureComponent { } export { InstallPrompt }; -export default withNamespaces()(InstallPrompt); +export default withTranslation()(InstallPrompt); diff --git a/src/components/Layout/__snapshots__/test.js.snap b/src/components/Layout/__snapshots__/test.js.snap index fae7cad..27a00b1 100644 --- a/src/components/Layout/__snapshots__/test.js.snap +++ b/src/components/Layout/__snapshots__/test.js.snap @@ -13,13 +13,13 @@ exports[`Layout rendering 1`] = ` - Example content - diff --git a/src/components/Loader/index.js b/src/components/Loader/index.js index ce571ee..83336d9 100644 --- a/src/components/Loader/index.js +++ b/src/components/Loader/index.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { withNamespaces } from 'react-i18next'; +import { withTranslation } from 'react-i18next'; import LoaderIcon from 'react-feather/dist/icons/loader'; @@ -18,4 +18,4 @@ Loader.propTypes = { }; export { Loader }; -export default withNamespaces()(Loader); +export default withTranslation()(Loader); diff --git a/src/components/LocaleSwitcher/__snapshots__/test.js.snap b/src/components/LocaleSwitcher/__snapshots__/test.js.snap index 5476f36..b5b32fb 100644 --- a/src/components/LocaleSwitcher/__snapshots__/test.js.snap +++ b/src/components/LocaleSwitcher/__snapshots__/test.js.snap @@ -2,9 +2,9 @@ exports[`LocaleSwitcher rendering 1`] = `