Skip to content

Commit 256565c

Browse files
rubennortefacebook-github-bot
authored andcommitted
Add initial Fantom test for the basic global environment setup (#53268)
Summary: Pull Request resolved: #53268 Changelog: [internal] Adds tests for the global environment setup in RN. Reviewed By: rshest Differential Revision: D78415432 fbshipit-source-id: 8fdafee93ddbdf17770f3cb2069bf4834bb43dac
1 parent f9c2aaf commit 256565c

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow strict-local
8+
* @format
9+
* @oncall react_native
10+
*/
11+
12+
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
13+
14+
describe('setUpDefaultReactNativeEnvironment (globals)', () => {
15+
it('should be exposed as globalThis, global, window and self', () => {
16+
expect(globalThis).toBe(global);
17+
expect(globalThis).toBe(window);
18+
expect(globalThis).toBe(self);
19+
});
20+
21+
it('should provide process.env.NODE_ENV', () => {
22+
expect(process.env.NODE_ENV).toBe('development');
23+
});
24+
25+
it('should provide the __DEV__ constant', () => {
26+
expect(__DEV__).toBe(true);
27+
});
28+
});

0 commit comments

Comments
 (0)