Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
};
3 changes: 1 addition & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export default [
ignores: [
'dist/',
'node_modules/',
'src/__mocks__/',
'src/__tests__/',
'tests',
],
},
pluginJs.configs.recommended,
Expand Down
26 changes: 7 additions & 19 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.test.ts', '**/__tests__/**/*.test.tsx'],
preset: 'react-native',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts', '**/*.test.tsx'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
diagnostics: {
ignoreCodes: [151002], // Ignore "Could not find a declaration file" warnings
},
},
],
},
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/__tests__/**',
'!src/index.ts',
],
coverageThreshold: {
Expand All @@ -29,15 +17,15 @@ module.exports = {
},
},
moduleNameMapper: {
'^@tetherto/wdk-react-native-secure-storage$': '<rootDir>/src/__mocks__/secureStorage.ts',
'^react$': '<rootDir>/src/__mocks__/react.ts',
'^@src/(.*)$': '<rootDir>/src/$1',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @src path alias (line 20) isn't used anywhere in tests or source. Can be removed to keep config clean.

'^@tetherto/wdk-react-native-secure-storage$': '<rootDir>/tests/__mocks__/secureStorage.ts'
},
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
// Ignore React Native modules if not available
modulePathIgnorePatterns: ['<rootDir>/node_modules/'],
// Allow tests to run without all dependencies
transformIgnorePatterns: [
'node_modules/(?!(react-native|@react-native|react-native-mmkv|react-native-bare-kit|@tetherto/pear-wrk-wdk)/)',
'node_modules/(?!(react-native|@react-native|react-native-mmkv|react-native-bare-kit|@tetherto/pear-wrk-wdk|immer)/)',
],
};

Loading