Skip to content

Commit 763709c

Browse files
authored
Merge pull request #705 from Iterable/feature/MOB-12158-improve-iterable-ts-test-coverage
[MOB-12158] improve-iterable-ts-test-coverage
2 parents dfbc762 + 5917c04 commit 763709c

File tree

8 files changed

+1218
-826
lines changed

8 files changed

+1218
-826
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
setupFilesAfterEnv: [
55
'<rootDir>/node_modules/@testing-library/jest-native/extend-expect',
66
],
7-
testMatch: ['<rootDir>/src/__tests__/**/*.(test|spec).[jt]s?(x)'],
7+
testMatch: ['<rootDir>/src/**/*.(test|spec).[jt]s?(x)'],
88
transformIgnorePatterns: [
99
'node_modules/(?!(react-native|@react-native|@react-navigation|react-native-screens|react-native-safe-area-context|react-native-gesture-handler|react-native-webview|react-native-vector-icons)/)',
1010
],

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"add_build_info": "node scripts/autoCreatePackageInfo.js",
3737
"example": "yarn workspace @iterable/react-native-sdk-example",
3838
"test": "jest",
39+
"test:watch": "jest --watch",
3940
"test:coverage": "jest --coverage",
4041
"typecheck": "tsc",
4142
"lint": "eslint \"**/*.{js,ts,tsx}\"",
@@ -70,10 +71,10 @@
7071
"@react-native/eslint-config": "0.79.3",
7172
"@react-native/metro-config": "0.79.3",
7273
"@react-native/typescript-config": "0.79.3",
73-
"@react-navigation/native": "^6.1.18",
74+
"@react-navigation/native": "^7.1.14",
7475
"@release-it/conventional-changelog": "^9.0.2",
7576
"@testing-library/jest-native": "^5.4.3",
76-
"@testing-library/react-native": "^12.7.2",
77+
"@testing-library/react-native": "^13.3.3",
7778
"@types/jest": "^29.5.5",
7879
"@types/react": "^19.0.0",
7980
"@types/react-native-vector-icons": "^6.4.18",
@@ -91,15 +92,15 @@
9192
"react": "19.0.0",
9293
"react-native": "0.79.3",
9394
"react-native-builder-bob": "^0.40.4",
94-
"react-native-gesture-handler": "^2.24.0",
95-
"react-native-safe-area-context": "^5.1.0",
96-
"react-native-screens": "^4.9.1",
95+
"react-native-gesture-handler": "^2.26.0",
96+
"react-native-safe-area-context": "^5.4.0",
97+
"react-native-screens": "^4.10.0",
9798
"react-native-vector-icons": "^10.2.0",
98-
"react-native-webview": "^13.13.1",
99+
"react-native-webview": "^13.14.1",
99100
"react-test-renderer": "19.0.0",
100101
"release-it": "^17.10.0",
101102
"turbo": "^1.10.7",
102-
"typedoc": "^0.26.11",
103+
"typedoc": "^0.28.13",
103104
"typedoc-plugin-coverage": "^3.3.0",
104105
"typedoc-plugin-mermaid": "^1.12.0",
105106
"typescript": "^5.2.2"

src/__mocks__/MockRNIterableAPI.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@ export class MockRNIterableAPI {
6666
MockRNIterableAPI.attributionInfo = attributionInfo;
6767
}
6868

69-
static initializeWithApiKey = jest.fn();
69+
static initializeWithApiKey = jest.fn().mockResolvedValue(true);
70+
71+
static initialize2WithApiKey = jest.fn().mockResolvedValue(true);
72+
73+
static wakeApp = jest.fn()
7074

7175
static setInAppShowResponse = jest.fn();
7276

77+
static passAlongAuthToken = jest.fn();
78+
7379
static async getInAppMessages(): Promise<IterableInAppMessage[] | undefined> {
7480
return await new Promise((resolve) => {
7581
resolve(MockRNIterableAPI.messages);

0 commit comments

Comments
 (0)