File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change
1
+ import * as ReactNative from 'react-native' ;
1
2
import React from 'react' ;
2
3
import { render } from '@testing-library/react-native' ;
3
4
import { BannerAd , BannerAdSize } from '../src' ;
4
5
5
6
const MOCK_ID = 'MOCK_ID' ;
6
7
8
+ jest . doMock ( 'react-native' , ( ) => {
9
+ return Object . setPrototypeOf (
10
+ {
11
+ ...ReactNative ,
12
+ Platform : {
13
+ OS : 'android' ,
14
+ select : ( ) => { } ,
15
+ } ,
16
+ } ,
17
+ ReactNative ,
18
+ ) ;
19
+ } ) ;
20
+
7
21
describe ( 'Google Mobile Ads Banner' , function ( ) {
8
22
it ( 'throws if no unit ID was provided.' , function ( ) {
9
23
let errorMsg ;
Original file line number Diff line number Diff line change @@ -3,10 +3,6 @@ import * as ReactNative from 'react-native';
3
3
jest . doMock ( 'react-native' , ( ) => {
4
4
return Object . setPrototypeOf (
5
5
{
6
- Platform : {
7
- OS : 'android' ,
8
- select : ( ) => { } ,
9
- } ,
10
6
NativeModules : {
11
7
...ReactNative . NativeModules ,
12
8
RNAppModule : {
You can’t perform that action at this time.
0 commit comments