File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,19 @@ jobs:
142
142
name : Lint
143
143
command : yarn lint
144
144
test-js :
145
+ parameters :
146
+ react-native-version :
147
+ type : string
148
+ default : ' '
145
149
executor : default
146
150
steps :
147
151
- *attach-workspace
152
+ - when :
153
+ condition : << parameters.react-native-version >>
154
+ steps :
155
+ - run :
156
+ name : Overriding react-native version
157
+ command : yarn add --dev react-native@<< parameters.react-native-version >>
148
158
- run :
149
159
name : Run Jest
150
160
command : yarn test
Original file line number Diff line number Diff line change 1
- jest . mock ( 'react-native/Libraries/Utilities/PolyfillFunctions' , ( ) => ( {
2
- polyfillGlobal : jest . fn ( ) ,
3
- } ) ) ;
4
-
5
1
describe ( 'Index' , function ( ) {
6
2
it ( "shouldn't apply URL and URLSearchParams on import" , ( ) => {
7
3
expect ( global . REACT_NATIVE_URL_POLYFILL ) . toBeUndefined ( ) ;
Original file line number Diff line number Diff line change 1
1
import './js/ios10Fix' ;
2
2
3
- import { polyfillGlobal } from 'react-native/Libraries/Utilities/PolyfillFunctions' ;
4
-
5
3
import { name , version } from './package.json' ;
6
4
7
5
export * from './js/URL' ;
@@ -10,9 +8,6 @@ export * from './js/URLSearchParams';
10
8
export function setupURLPolyfill ( ) {
11
9
global . REACT_NATIVE_URL_POLYFILL = `${ name } @${ version } ` ;
12
10
13
- polyfillGlobal ( 'URL' , ( ) => require ( './js/URL' ) . URL ) ;
14
- polyfillGlobal (
15
- 'URLSearchParams' ,
16
- ( ) => require ( './js/URLSearchParams' ) . URLSearchParams ,
17
- ) ;
11
+ global . URL = require ( './js/URL' ) . URL ;
12
+ global . URLSearchParams = require ( './js/URLSearchParams' ) . URLSearchParams ;
18
13
}
You can’t perform that action at this time.
0 commit comments