diff --git a/client/src/__mocks__/fileMock.js b/client/src/__mocks__/fileMock.js deleted file mode 100644 index f053ebf797..0000000000 --- a/client/src/__mocks__/fileMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/client/src/__mocks__/fileMock.ts b/client/src/__mocks__/fileMock.ts new file mode 100644 index 0000000000..ff8b4c5632 --- /dev/null +++ b/client/src/__mocks__/fileMock.ts @@ -0,0 +1 @@ +export default {}; diff --git a/client/src/__mocks__/gatsby-link.js b/client/src/__mocks__/gatsby-link.js deleted file mode 100644 index 4dcca4213e..0000000000 --- a/client/src/__mocks__/gatsby-link.js +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable */ -import React from 'react'; - -const mockComponent = name => props => - React.createElement(name, props, props.children); - -export const navigateTo = () => {}; -export default mockComponent('MockedLink'); diff --git a/client/src/__mocks__/gatsby-link.ts b/client/src/__mocks__/gatsby-link.ts new file mode 100644 index 0000000000..c6e13b0505 --- /dev/null +++ b/client/src/__mocks__/gatsby-link.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +import React from 'react'; + +const mockComponent = + (name: string) => + ( + props: React.InputHTMLAttributes & + React.ClassAttributes + ) => + React.createElement(name, props, props.children); + +export const navigateTo = () => {}; +export default mockComponent('MockedLink'); diff --git a/client/src/__mocks__/styleMock.js b/client/src/__mocks__/styleMock.js deleted file mode 100644 index f053ebf797..0000000000 --- a/client/src/__mocks__/styleMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/client/src/__mocks__/styleMock.ts b/client/src/__mocks__/styleMock.ts new file mode 100644 index 0000000000..ff8b4c5632 --- /dev/null +++ b/client/src/__mocks__/styleMock.ts @@ -0,0 +1 @@ +export default {}; diff --git a/jest.config.js b/jest.config.js index 1ac15b043b..20a49f14a3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,11 +2,11 @@ module.exports = { testPathIgnorePatterns: ['/node_modules/'], moduleNameMapper: { '\\.(jpg|jpeg|png|svg|woff|woff2)$': - '/client/src/__mocks__/fileMock.js', + '/client/src/__mocks__/fileMock.ts', // Plain CSS - match css files that don't end with // '.module.css' https://regex101.com/r/VzwrKH/4 '^(?!.*\\.module\\.css$).*\\.css$': - '/client/src/__mocks__/styleMock.js', + '/client/src/__mocks__/styleMock.ts', // CSS Modules - match files that end with 'module.css' '\\.module\\.css$': 'identity-obj-proxy', '^lodash-es$': 'lodash'