Skip to content

Commit f1649f8

Browse files
committed
Fix warnings in tests
1 parent 9fd8037 commit f1649f8

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

eslint.config.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ export default [
5757
'scripts/secretFiles.ts',
5858
'scripts/themeServer.ts',
5959
'scripts/updateVersion.ts',
60-
'src/__tests__/components/CreateWalletSelectCryptoRow.test.tsx',
61-
'src/__tests__/components/MenuTabs.test.tsx',
62-
'src/__tests__/utils.test.ts',
63-
'src/__tests__/utils/parseMarkedText.test.ts',
6460
'src/actions/BackupModalActions.tsx',
6561
'src/actions/CategoriesActions.ts',
6662
'src/actions/CountryListActions.tsx',

src/__tests__/components/CreateWalletSelectCryptoRow.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('WalletListRow', () => {
2323
it('should render with loading props', () => {
2424
const pluginId = 'bitcoin'
2525
const walletName = 'My bitcoin wallet'
26-
const onPress = () => undefined
26+
const onPress = (): void => {}
2727
const rightSide = (
2828
<IonIcon size={26} color="#66EDA8" name="chevron-forward-outline" />
2929
)

src/__tests__/components/MenuTabs.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ describe('MenuTabs', () => {
1111
const rendered = render(
1212
<FakeProviders>
1313
<MenuTabs
14-
// @ts-expect-error
14+
// @ts-expect-error The menu expects a special navigation object,
15+
// but our mock one is close enough:
1516
navigation={fakeNavigation}
16-
// @ts-expect-error
17+
// @ts-expect-error The subset of router state we need:
1718
state={{ index: 0, routes: [] }}
1819
/>
1920
</FakeProviders>

src/__tests__/utils.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,8 @@ describe('precisionAdjust', function () {
316316
}
317317
}
318318

319-
for (const key in tests) {
320-
// @ts-expect-error
321-
const { input, output } = tests[key]
319+
for (const key of Object.keys(tests)) {
320+
const { input, output } = tests[key as keyof typeof tests]
322321
const {
323322
displayDenominationMultiplier,
324323
primaryExchangeMultiplier,

src/__tests__/utils/parseMarkedText.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { describe, it } from '@jest/globals'
2-
import { asObject, asTuple, asUnknown, asValue, type Cleaner } from 'cleaners'
2+
import { asObject, asTuple, asValue, type Cleaner } from 'cleaners'
33

44
import { parseMarkedText } from '../../util/parseMarkedText'
55

66
describe('parseMarkedText', () => {
7-
const asJsxElement = (asChildren: Cleaner<any> = asUnknown) =>
7+
const asJsxElement = <T>(
8+
asChildren: Cleaner<T>
9+
): Cleaner<{ props: { children: T } }> =>
810
asObject({
911
props: asObject({
1012
children: asChildren

0 commit comments

Comments
 (0)