File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -125,4 +125,16 @@ export interface Spec extends TurboModule {
125125 addListener ( eventName : string ) : void ;
126126 removeListeners ( count : number ) : void ;
127127}
128- export default TurboModuleRegistry . getEnforcing < Spec > ( 'RNIterableAPI' ) ;
128+
129+ // Check if we're in a test environment
130+ const isTestEnvironment = ( ) => {
131+ return (
132+ typeof jest !== 'undefined' ||
133+ process . env . NODE_ENV === 'test' ||
134+ process . env . JEST_WORKER_ID !== undefined
135+ ) ;
136+ } ;
137+
138+ export default isTestEnvironment ( )
139+ ? undefined
140+ : TurboModuleRegistry . getEnforcing < Spec > ( 'RNIterableAPI' ) ;
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ export class Iterable {
324324 Iterable ?. logger ?. log ( 'getAttributionInfo' ) ;
325325
326326 return RNIterableAPI . getAttributionInfo ( ) . then (
327- ( dict ) => {
327+ ( dict : { campaignId : number ; templateId : number ; messageId : string } | null ) => {
328328 if ( dict ) {
329329 return new IterableAttributionInfo (
330330 dict . campaignId as number ,
Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ export class IterableInboxDataModel {
9999 ) ;
100100
101101 return RNIterableAPI . getHtmlInAppContentForMessage ( id ) . then (
102- ( content ) => {
103- return IterableHtmlInAppContent . fromDict ( content as unknown as IterableHtmlInAppContentRaw ) ;
102+ ( content : IterableHtmlInAppContentRaw ) => {
103+ return IterableHtmlInAppContent . fromDict ( content ) ;
104104 }
105105 ) ;
106106 }
@@ -136,8 +136,8 @@ export class IterableInboxDataModel {
136136 */
137137 async refresh ( ) : Promise < IterableInboxRowViewModel [ ] > {
138138 return RNIterableAPI . getInboxMessages ( ) . then (
139- ( messages ) => {
140- return this . processMessages ( messages as unknown as IterableInAppMessage [ ] ) ;
139+ ( messages : IterableInAppMessage [ ] ) => {
140+ return this . processMessages ( messages ) ;
141141 } ,
142142 ( ) => {
143143 return [ ] ;
You can’t perform that action at this time.
0 commit comments