File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
packages/react-native/src/private/webapis/performance/__tests__ Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 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+ */
10+
11+ import type Performance from '../Performance' ;
12+
13+ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
14+
15+ declare var performance: Performance ;
16+
17+ describe ( 'performance.memory' , ( ) => {
18+ it ( 'provides memory info' , ( ) => {
19+ const memoryInfo = performance . memory ;
20+
21+ expect ( memoryInfo . usedJSHeapSize ) . toBeGreaterThan ( 0 ) ;
22+ expect ( memoryInfo . totalJSHeapSize ) . toBeGreaterThan ( 0 ) ;
23+ } ) ;
24+
25+ it ( 'always returns a new object' , ( ) => {
26+ expect ( performance . memory ) . not . toBe ( performance . memory ) ;
27+ } ) ;
28+ } ) ;
You can’t perform that action at this time.
0 commit comments