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:
Kita Pairojtanachai (Chris)
2022-02-10 12:10:02 -05:00
committed by GitHub
parent ee0fb44c62
commit 22acd4894d
7 changed files with 17 additions and 12 deletions

View File

@ -1 +0,0 @@
module.exports = {};

View File

@ -0,0 +1 @@
export default {};

View File

@ -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');

View 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');

View File

@ -1 +0,0 @@
module.exports = {};

View File

@ -0,0 +1 @@
export default {};

View File

@ -2,11 +2,11 @@ module.exports = {
testPathIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
'\\.(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
// '.module.css' https://regex101.com/r/VzwrKH/4
'^(?!.*\\.module\\.css$).*\\.css$':
'<rootDir>/client/src/__mocks__/styleMock.js',
'<rootDir>/client/src/__mocks__/styleMock.ts',
// CSS Modules - match files that end with 'module.css'
'\\.module\\.css$': 'identity-obj-proxy',
'^lodash-es$': 'lodash'