Skip to content

Commit 1cc6b50

Browse files
committed
test: remove remaining platform specific tests in network logger
1 parent 27ce7c8 commit 1cc6b50

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

test/modules/NetworkLogger.spec.ts

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,7 @@ describe('NetworkLogger Module', () => {
6767
expect(reportNetworkLog).toBeCalledWith(network);
6868
});
6969

70-
it('should send log network when Platform is android', () => {
71-
Interceptor.setOnDoneCallback = jest
72-
.fn()
73-
.mockImplementation((callback) => callback(clone(network)));
74-
NetworkLogger.setEnabled(true);
75-
76-
expect(reportNetworkLog).toBeCalledWith(network);
77-
});
78-
79-
it('should send log network when setNetworkDataObfuscationHandler is set and Platform is ios', async () => {
80-
const randomString = '28930q938jqhd';
81-
Interceptor.setOnDoneCallback = jest
82-
.fn()
83-
.mockImplementation((callback) => callback(clone(network)));
84-
NetworkLogger.setNetworkDataObfuscationHandler((networkData) => {
85-
networkData.requestHeaders.token = randomString;
86-
return Promise.resolve(networkData);
87-
});
88-
NetworkLogger.setEnabled(true);
89-
90-
await waitForExpect(() => {
91-
const newData = clone(network);
92-
newData.requestHeaders.token = randomString;
93-
expect(reportNetworkLog).toBeCalledWith(newData);
94-
});
95-
});
96-
97-
it('should send log network when setNetworkDataObfuscationHandler is set and Platform is android', async () => {
70+
it('should send log network when setNetworkDataObfuscationHandler is set', async () => {
9871
const randomString = '28930q938jqhd';
9972
Interceptor.setOnDoneCallback = jest
10073
.fn()
@@ -112,7 +85,7 @@ describe('NetworkLogger Module', () => {
11285
});
11386
});
11487

115-
it('should not break if network data obfuscation fails when platform is android', async () => {
88+
it('should not break if network data obfuscation fails', async () => {
11689
// Avoid the console.error to clutter the test log
11790
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
11891

0 commit comments

Comments
 (0)