Jest config cleanup (#807)

* Jest config cleanup

* jsx linting
This commit is contained in:
Jaco 2021-09-01 19:39:04 +03:00 committed by GitHub
parent 68770d3643
commit 6a9f58952e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 617 additions and 676 deletions

View File

@ -12,14 +12,5 @@ module.exports = {
'\\.(css|less)$': 'empty/object',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js'
},
modulePathIgnorePatterns: [
'<rootDir>/packages/extension/build',
'<rootDir>/packages/extension-base/build',
'<rootDir>/packages/extension-chains/build',
'<rootDir>/packages/extension-dapp/build',
'<rootDir>/packages/extension-inject/build',
'<rootDir>/packages/extension-ui/build'
],
testEnvironment: 'jsdom',
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
testEnvironment: 'jsdom'
};

View File

@ -8,13 +8,13 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^5.6.2-6",
"@polkadot/keyring": "^7.2.2-5",
"@polkadot/networks": "^7.2.2-5",
"@polkadot/types": "^5.6.2-6",
"@polkadot/util": "^7.2.2-5",
"@polkadot/util-crypto": "^7.2.2-5",
"@polkadot/x-fetch": "^7.2.2-5",
"@polkadot/api": "^5.7.2-2",
"@polkadot/keyring": "^7.3.1",
"@polkadot/networks": "^7.3.1",
"@polkadot/types": "^5.7.2-2",
"@polkadot/util": "^7.3.1",
"@polkadot/util-crypto": "^7.3.1",
"@polkadot/x-fetch": "^7.3.1",
"babel-core": "^7.0.0-bridge.0",
"safe-buffer": "^5.2.1",
"typescript": "^4.3.5",
@ -41,7 +41,7 @@
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@polkadot/dev": "^0.62.62",
"@polkadot/dev": "^0.62.64",
"@types/jest": "^27.0.1",
"i18next-scanner": "^3.0.0",
"sinon-chrome": "^3.0.1",

View File

@ -9,11 +9,11 @@
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.15.3",
"@polkadot/api": "^5.6.2-6",
"@polkadot/api": "^5.7.2-2",
"@polkadot/extension-dapp": "^0.39.4-5",
"@polkadot/extension-inject": "^0.39.4-5",
"@polkadot/keyring": "^7.2.2-5",
"@polkadot/phishing": "^0.6.270",
"@polkadot/ui-keyring": "^0.85.2-0"
"@polkadot/keyring": "^7.3.1",
"@polkadot/phishing": "^0.6.276",
"@polkadot/ui-keyring": "^0.85.3"
}
}

View File

@ -9,7 +9,7 @@
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.15.3",
"@polkadot/networks": "^7.2.2-5"
"@polkadot/networks": "^7.3.1"
},
"peerDependencies": {
"@polkadot/api": "*"

View File

@ -11,8 +11,8 @@
"@babel/runtime": "^7.15.3",
"@metamask/detect-provider": "^1.2.0",
"@polkadot/extension-inject": "^0.39.4-5",
"@polkadot/util": "^7.2.2-5",
"@polkadot/util-crypto": "^7.2.2-5",
"@polkadot/util": "^7.3.1",
"@polkadot/util-crypto": "^7.3.1",
"web3": "^1.5.2"
},
"peerDependencies": {

View File

@ -15,13 +15,13 @@
"@polkadot/extension-base": "^0.39.4-5",
"@polkadot/extension-dapp": "^0.39.4-5",
"@polkadot/extension-inject": "^0.39.4-5",
"@polkadot/hw-ledger": "^7.2.2-5",
"@polkadot/keyring": "^7.2.2-5",
"@polkadot/networks": "^7.2.2-5",
"@polkadot/react-identicon": "^0.85.2-0",
"@polkadot/react-qr": "^0.85.2-0",
"@polkadot/util": "^7.2.2-5",
"@polkadot/util-crypto": "^7.2.2-5",
"@polkadot/hw-ledger": "^7.3.1",
"@polkadot/keyring": "^7.3.1",
"@polkadot/networks": "^7.3.1",
"@polkadot/react-identicon": "^0.85.3",
"@polkadot/react-qr": "^0.85.3",
"@polkadot/util": "^7.3.1",
"@polkadot/util-crypto": "^7.3.1",
"file-saver": "^2.0.5",
"i18next": "^20.4.0",
"react": "^17.0.2",

View File

@ -32,7 +32,7 @@ function AddAccount ({ className }: Props): React.ReactElement<Props> {
/>
<div className={className}>
<div className='image'>
<AddAccountImage onClick={_onClick}/>
<AddAccountImage onClick={_onClick} />
</div>
<div className='no-accounts'>
<p>{t<string>("You currently don't have any accounts. Create your first account to get started.")}</p>

View File

@ -68,9 +68,9 @@ function AddAccountImage ({ className, onClick }: Props): React.ReactElement<Pro
id='filter0_f' x='-3' y='-7' width='271' height='284.846' filterUnits='userSpaceOnUse'
colorInterpolationFilters='sRGB'
>
<feFlood floodOpacity='0' result='BackgroundImageFix'/>
<feBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape'/>
<feGaussianBlur stdDeviation='10' result='effect1_foregroundBlur'/>
<feFlood floodOpacity='0' result='BackgroundImageFix' />
<feBlend mode='normal' in='SourceGraphic' in2='BackgroundImageFix' result='shape' />
<feGaussianBlur stdDeviation='10' result='effect1_foregroundBlur' />
</filter>
</defs>
</svg>

View File

@ -55,7 +55,7 @@ describe('Derive', () => {
>
<ThemeProvider theme={themes.dark}>
<Route path='/account/derive/:address'>
<Derive isLocked={locked}/>
<Derive isLocked={locked} />
</Route>
</ThemeProvider>
</AccountContext.Provider>

View File

@ -179,7 +179,7 @@ export default function SelectParent ({ className, isLocked, onDerivationConfirm
</>
)}
</div>
<VerticalSpace/>
<VerticalSpace />
<ButtonArea>
<NextStepButton
data-button-action='create derived account'

View File

@ -152,7 +152,7 @@ function ImportLedger ({ className }: Props): React.ReactElement {
</Warning>
)}
</div>
<VerticalSpace/>
<VerticalSpace />
<ButtonArea>
{ledgerLocked
? (

View File

@ -95,7 +95,7 @@ function SeedAndPath ({ className, onAccountChange, onNextStep }: Props): React.
className='advancedToggle'
onClick={_onToggleAdvanced}
>
<FontAwesomeIcon icon={advanced ? faCaretDown : faCaretRight}/>
<FontAwesomeIcon icon={advanced ? faCaretDown : faCaretRight} />
<span>{t<string>('advanced')}</span>
</div>
{ advanced && (

View File

@ -122,8 +122,8 @@ export default function Popup (): React.ReactElement {
: metaRequests && metaRequests.length
? wrapWithErrorBoundary(<Metadata />, 'metadata')
: signRequests && signRequests.length
? wrapWithErrorBoundary(<Signing/>, 'signing')
: wrapWithErrorBoundary(<Accounts/>, 'accounts')
? wrapWithErrorBoundary(<Signing />, 'signing')
: wrapWithErrorBoundary(<Accounts />, 'accounts')
: wrapWithErrorBoundary(<Welcome />, 'welcome');
return (

View File

@ -216,7 +216,7 @@ function Address ({ actions, address, children, className, genesisHash, isExtern
</div>
</div>
<div className='name displaced'>
<Name/>
<Name />
</div>
</>
)
@ -225,7 +225,7 @@ function Address ({ actions, address, children, className, genesisHash, isExtern
className='name'
data-field='name'
>
<Name/>
<Name />
</div>
)
}
@ -249,7 +249,7 @@ function Address ({ actions, address, children, className, genesisHash, isExtern
>
{formatted || address || t('<unknown>')}
</div>
<CopyToClipboard text={(formatted && formatted) || ''} >
<CopyToClipboard text={(formatted && formatted) || ''}>
<FontAwesomeIcon
className='copyIcon'
icon={faCopy}

View File

@ -56,7 +56,7 @@ class ErrorBoundary extends React.Component<Props> {
replace: { message: error.message }
})}
</div>
<VerticalSpace/>
<VerticalSpace />
<ButtonArea>
<Button
onClick={this.#goHome}

View File

@ -100,9 +100,9 @@ function InputFile ({ accept, className = '', clearContent, convertHex, isDisabl
ref={dropRef}
>
{({ getInputProps, getRootProps }): JSX.Element => (
<div {...getRootProps({ className: classes('ui--InputFile', isError ? 'error' : '', className) })} >
<div {...getRootProps({ className: classes('ui--InputFile', isError ? 'error' : '', className) })}>
<input {...getInputProps()} />
<em className='label' >
<em className='label'>
{
!file || clearContent
? placeholder || t('click to select or drag and drop the file here')

View File

@ -9,7 +9,7 @@ interface Props {
}
function VerticalSpace ({ className }: Props): React.ReactElement<Props> {
return <div className={className}/>;
return <div className={className} />;
}
export default styled(VerticalSpace)`

View File

@ -101,10 +101,10 @@ function Header ({ children, className = '', showAdd, showBackArrow, showSetting
)}
</div>
{isAddOpen && (
<MenuAdd reference={addRef}/>
<MenuAdd reference={addRef} />
)}
{isSettingsOpen && (
<MenuSettings reference={setRef}/>
<MenuSettings reference={setRef} />
)}
{children}
</div>

View File

@ -99,7 +99,7 @@ function MenuSettings ({ className, reference }: Props): React.ReactElement<Prop
text={t<string>('Manage Website Access')}
/>
</MenuItem>
<MenuDivider/>
<MenuDivider />
<MenuItem
className='setting'
title={t<string>('External accounts and Access')}

View File

@ -12,7 +12,7 @@
"@polkadot/extension-ui": "^0.39.4-5"
},
"devDependencies": {
"@polkadot/dev": "^0.62.62",
"@polkadot/dev": "^0.62.64",
"babel-loader": "^8.2.2",
"browser-resolve": "^2.0.0",
"buffer": "^6.0.3",

1196
yarn.lock

File diff suppressed because it is too large Load Diff