Skip to content

Commit

Permalink
add test for setFlushBatchSize
Browse files Browse the repository at this point in the history
  • Loading branch information
zihejia committed Dec 1, 2023
1 parent 750352e commit 725749e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ test(`it calls MixpanelReactNative setUseIpAddressForGeolocation`, async () => {
expect(NativeModules.MixpanelReactNative.setUseIpAddressForGeolocation).toBeCalledWith("token", true);
});

test(`it calls MixpanelReactNative setFlushBatchSize`, async () => {
const mixpanel = await Mixpanel.init("token", true);
mixpanel.setFlushBatchSize(20);
expect(NativeModules.MixpanelReactNative.setFlushBatchSize).toBeCalledWith("token", true);
});

test(`it calls MixpanelReactNative hasOptedOutTracking`, async () => {
const mixpanel = await Mixpanel.init("token", true);
mixpanel.hasOptedOutTracking();
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export class Mixpanel {
MixpanelReactNative.setFlushBatchSize(this.token, flushBatchSize);
}


/**
* Will return true if the user has opted out from tracking.
*
Expand Down

0 comments on commit 725749e

Please sign in to comment.