Skip to content

Commit 1b307bf

Browse files
authored
test: cover components of NewWallet (#38)
1 parent 4ee7093 commit 1b307bf

File tree

75 files changed

+1232
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1232
-503
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
quotes: ['warn', 'single'],
1515
semi: ['warn', 'always'],
1616
'@typescript-eslint/no-require-imports': 'warn',
17+
'@typescript-eslint/no-unused-vars': 'warn',
1718
'no-unused-vars': 'warn',
1819
'no-undef': 'warn',
1920
},

.github/workflows/node.js.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: ['main']
99
pull_request:
10-
branches: [ "main" ]
10+
branches: ['main']
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
strategy:
@@ -20,12 +19,12 @@ jobs:
2019
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2120

2221
steps:
23-
- uses: actions/checkout@v4
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
cache: 'npm'
29-
- run: npm i
30-
- run: npm run check
31-
- run: npm test
22+
- uses: actions/checkout@v4
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
- run: npm i
29+
- run: npm run check
30+
- run: npm test

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ coverage
1010
*.lock
1111
*.log
1212
.DS_Store
13-
eslint.config.mjs

.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ module.exports = {
66
printWidth: 100,
77
bracketSpacing: true,
88
arrowParens: 'avoid',
9+
// Automatic import sorting
10+
importOrder: ['^@core/(.*)$', '^@server/(.*)$', '^@ui/(.*)$', '^[./]'],
11+
importOrderSeparation: true,
12+
importOrderSortSpecifiers: true,
13+
plugins: ['@trivago/prettier-plugin-sort-imports'],
914
};

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AppRegistry } from 'react-native';
2-
import App from './src/App';
2+
33
import { name as appName } from './app.json';
44
import './polyfill';
5+
import App from './src/App';
56

67
AppRegistry.registerComponent(appName, () => App);

metro.config.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ config.resolver.extraNodeModules = {
1818
config.resolver.resolveRequest = (context, moduleName, platform) => {
1919
if (moduleName === 'crypto') {
2020
// when importing crypto, resolve to react-native-quick-crypto
21-
return context.resolveRequest(
22-
context,
23-
'react-native-quick-crypto',
24-
platform,
25-
)
21+
return context.resolveRequest(context, 'react-native-quick-crypto', platform);
2622
}
2723
// otherwise chain to the standard Metro resolver.
28-
return context.resolveRequest(context, moduleName, platform)
29-
}
24+
return context.resolveRequest(context, moduleName, platform);
25+
};
3026

3127
module.exports = withNativeWind(config, { input: './global.css' });

package-lock.json

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@react-native/metro-config": "0.81.4",
6363
"@react-native/typescript-config": "0.81.4",
6464
"@testing-library/react-native": "^13.3.3",
65+
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
6566
"@types/jest": "^29.5.13",
6667
"@types/react": "^19.1.0",
6768
"@types/react-test-renderer": "^19.1.0",

polyfill.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Fix `Error: crypto.getRandomValues must be defined react-native`
22
// which is not available in React Native and used by @scure/bip39
33
// https://www.npmjs.com/package/react-native-get-random-values
4+
import { Buffer } from 'buffer/';
5+
import process from 'process';
6+
// https://github.com/maksimlya/react-native-fast-encoder/
7+
import TextEncoder from 'react-native-fast-encoder';
48
import 'react-native-get-random-values';
5-
69
// Speed up crypto operations
710
// https://www.npmjs.com/package/react-native-quick-crypto?activeTab=readme
811
import { install } from 'react-native-quick-crypto';
12+
913
install();
1014

11-
// https://github.com/maksimlya/react-native-fast-encoder/
12-
import TextEncoder from 'react-native-fast-encoder';
1315
global.TextEncoder = TextEncoder;
1416
global.TextDecoder = TextEncoder;
1517

16-
import { Buffer } from 'buffer/';
17-
import process from 'process';
1818
global.process = process;
1919
global.Buffer = Buffer;

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
2+
13
import '../global.css';
24
import { Navigation } from './navigation/RootNavigator';
35
import { WalletProvider } from './providers/WalletContext';
4-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
5-
66

77
const queryClient = new QueryClient();
88

0 commit comments

Comments
 (0)