fix failing test

This commit is contained in:
Sudhanshu Gautam 2021-03-21 18:56:05 +05:30
parent 7cdb5206af
commit 3fa4a871fc
5 changed files with 14 additions and 10 deletions

View file

@ -23,7 +23,6 @@ module.exports = {
'prettier/prettier': [ 'prettier/prettier': [
'error', 'error',
{ {
trailingComma: 'all',
arrowParens: 'always', arrowParens: 'always',
printWidth: 100, printWidth: 100,
}, },

View file

@ -7,6 +7,8 @@ module.exports = {
// using ts-jest // using ts-jest
transform: { transform: {
'^.+\\.tsx?$': 'ts-jest', '^.+\\.tsx?$': 'ts-jest',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'jest-transform-stub',
}, },
// Runs special logic, such as cleaning up components // Runs special logic, such as cleaning up components
@ -24,7 +26,6 @@ module.exports = {
moduleNameMapper: { moduleNameMapper: {
'^.+\\.(css|scss)$': 'identity-obj-proxy', '^.+\\.(css|scss)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '^.+.(png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'<rootDir>/fileMocks.js',
}, },
}; };

View file

@ -66,6 +66,7 @@
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
"husky": "^3.0.5", "husky": "^3.0.5",
"jest": "^26.6.3", "jest": "^26.6.3",
"jest-transform-stub": "^2.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"pretty-quick": "^1.11.1", "pretty-quick": "^1.11.1",
"sass": "^1.32.2", "sass": "^1.32.2",

View file

@ -73,13 +73,11 @@ const ProfileSearch: FunctionComponent<Props> = ({ selectedVersion, onProfileCha
options: SearchData[], options: SearchData[],
state: FilterOptionsState<SearchData> state: FilterOptionsState<SearchData>
) => SearchData[] = (options, { inputValue }) => ) => SearchData[] = (options, { inputValue }) =>
throttle( throttle(() => {
() => return matchSorter(options, inputValue.replaceAll?.(' ', '') || inputValue, {
matchSorter(options, inputValue.replaceAll(' ', ''), { keys: ['search'],
keys: ['search'], }).slice(0, 10);
}).slice(0, 10), }, 1000)() || [];
1000
)() || [];
if (working) return <CircularProgress />; if (working) return <CircularProgress />;

View file

@ -7125,6 +7125,11 @@ jest-snapshot@^26.6.0, jest-snapshot@^26.6.2:
pretty-format "^26.6.2" pretty-format "^26.6.2"
semver "^7.3.2" semver "^7.3.2"
jest-transform-stub@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz#19018b0851f7568972147a5d60074b55f0225a7d"
integrity sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==
jest-util@^26.1.0, jest-util@^26.6.0, jest-util@^26.6.2: jest-util@^26.1.0, jest-util@^26.6.0, jest-util@^26.6.2:
version "26.6.2" version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1"