migrate certain files in __mocks__/ (#45071)
* change ref from styleMock.js to .ts * change ref from fileMock.js to .ts
This commit is contained in:
committed by
GitHub
parent
ee0fb44c62
commit
22acd4894d
@ -1 +0,0 @@
|
|||||||
module.exports = {};
|
|
1
client/src/__mocks__/fileMock.ts
Normal file
1
client/src/__mocks__/fileMock.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export default {};
|
@ -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');
|
|
13
client/src/__mocks__/gatsby-link.ts
Normal file
13
client/src/__mocks__/gatsby-link.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const mockComponent =
|
||||||
|
(name: string) =>
|
||||||
|
(
|
||||||
|
props: React.InputHTMLAttributes<HTMLInputElement> &
|
||||||
|
React.ClassAttributes<HTMLInputElement>
|
||||||
|
) =>
|
||||||
|
React.createElement(name, props, props.children);
|
||||||
|
|
||||||
|
export const navigateTo = () => {};
|
||||||
|
export default mockComponent('MockedLink');
|
@ -1 +0,0 @@
|
|||||||
module.exports = {};
|
|
1
client/src/__mocks__/styleMock.ts
Normal file
1
client/src/__mocks__/styleMock.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export default {};
|
@ -2,11 +2,11 @@ module.exports = {
|
|||||||
testPathIgnorePatterns: ['/node_modules/'],
|
testPathIgnorePatterns: ['/node_modules/'],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.(jpg|jpeg|png|svg|woff|woff2)$':
|
'\\.(jpg|jpeg|png|svg|woff|woff2)$':
|
||||||
'<rootDir>/client/src/__mocks__/fileMock.js',
|
'<rootDir>/client/src/__mocks__/fileMock.ts',
|
||||||
// Plain CSS - match css files that don't end with
|
// Plain CSS - match css files that don't end with
|
||||||
// '.module.css' https://regex101.com/r/VzwrKH/4
|
// '.module.css' https://regex101.com/r/VzwrKH/4
|
||||||
'^(?!.*\\.module\\.css$).*\\.css$':
|
'^(?!.*\\.module\\.css$).*\\.css$':
|
||||||
'<rootDir>/client/src/__mocks__/styleMock.js',
|
'<rootDir>/client/src/__mocks__/styleMock.ts',
|
||||||
// CSS Modules - match files that end with 'module.css'
|
// CSS Modules - match files that end with 'module.css'
|
||||||
'\\.module\\.css$': 'identity-obj-proxy',
|
'\\.module\\.css$': 'identity-obj-proxy',
|
||||||
'^lodash-es$': 'lodash'
|
'^lodash-es$': 'lodash'
|
||||||
|
Reference in New Issue
Block a user