File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
dom-event-testing-library/src
react-native-web/src/exports/Platform Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function hasPointerEvent() {
22
22
export function setPointerEvent ( bool ) {
23
23
const pointerCaptureFn = ( name ) => ( id ) => {
24
24
if ( typeof id !== 'number' ) {
25
- if ( process . env . NODE_DEV !== 'production' ) {
25
+ if ( process . env . NODE_ENV !== 'production' ) {
26
26
console . error ( 'A pointerId must be passed to "%s"' , name ) ;
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -14,4 +14,22 @@ describe('apis/Platform', () => {
14
14
) . toEqual ( 'web' ) ;
15
15
} ) ;
16
16
} ) ;
17
+
18
+ describe ( 'isTesting' , ( ) => {
19
+ const NODE_ENV_BACKUP = process . env . NODE_ENV ;
20
+
21
+ afterEach ( ( ) => {
22
+ process . env . NODE_ENV = NODE_ENV_BACKUP ;
23
+ } ) ;
24
+
25
+ test ( 'true when NODE_ENV is "test"' , ( ) => {
26
+ process . env . NODE_ENV = 'test' ;
27
+ expect ( Platform . isTesting ) . toEqual ( true ) ;
28
+ } ) ;
29
+
30
+ test ( 'false when NODE_ENV is not "test"' , ( ) => {
31
+ process . env . NODE_ENV = 'development' ;
32
+ expect ( Platform . isTesting ) . toEqual ( false ) ;
33
+ } ) ;
34
+ } ) ;
17
35
} ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const Platform = {
12
12
OS : 'web' ,
13
13
select : ( obj : Object ) : any => ( 'web' in obj ? obj . web : obj . default ) ,
14
14
get isTesting ( ) : boolean {
15
- if ( process . env . NODE_DEV === 'test' ) {
15
+ if ( process . env . NODE_ENV === 'test' ) {
16
16
return true ;
17
17
}
18
18
return false ;
You can’t perform that action at this time.
0 commit comments