File tree Expand file tree Collapse file tree 3 files changed +20
-18
lines changed
packages/react-native/scripts/hermes/__tests__ Expand file tree Collapse file tree 3 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 93
93
"jest-snapshot" : " ^29.7.0" ,
94
94
"markdownlint-cli2" : " ^0.17.2" ,
95
95
"markdownlint-rule-relative-links" : " ^3.0.0" ,
96
+ "memfs" : " ^4.7.7" ,
96
97
"metro-babel-register" : " ^0.82.5" ,
97
- "metro-memory-fs" : " ^0.82.5" ,
98
98
"metro-transform-plugins" : " ^0.82.5" ,
99
99
"micromatch" : " ^4.0.4" ,
100
100
"node-fetch" : " ^2.2.0" ,
Original file line number Diff line number Diff line change 8
8
* @format
9
9
*/
10
10
11
+ import typeof FS from 'fs' ;
12
+
11
13
import * as path from 'path' ;
12
14
13
15
const {
@@ -25,9 +27,12 @@ const {
25
27
setHermesTag,
26
28
shouldUsePrebuiltHermesC,
27
29
} = require ( '../hermes-utils' ) ;
28
- const MemoryFs = require ( 'metro-memory-fs' ) ;
29
30
const os = require ( 'os' ) ;
30
31
32
+ // $FlowFixMe[untyped-import] (OSS) memfs
33
+ // $FlowFixMe[cannot-resolve-module] (Meta) memfs
34
+ const { memfs} = require ( 'memfs' ) as { memfs : ( ) => { fs : FS } } ;
35
+
31
36
const hermesTag =
32
37
'hermes-2022-04-28-RNv0.69.0-15d07c2edd29a4ea0b8f15ab0588a0c1adb1200f' ;
33
38
const tarballContents = 'dummy string' ;
@@ -147,16 +152,8 @@ describe('hermes-utils', () => {
147
152
beforeEach ( ( ) => {
148
153
jest . resetModules ( ) ;
149
154
150
- jest . mock (
151
- 'fs' ,
152
- ( ) =>
153
- new MemoryFs ( {
154
- platform : process . platform === 'win32' ? 'win32' : 'posix' ,
155
- } ) ,
156
- ) ;
155
+ jest . mock ( 'fs' , ( ) => memfs ( ) . fs ) ;
157
156
fs = require ( 'fs' ) ;
158
- // $FlowFixMe[prop-missing]
159
- fs . reset ( ) ;
160
157
161
158
populateMockFilesystemWithHermesBuildScripts ( ) ;
162
159
Original file line number Diff line number Diff line change @@ -6823,6 +6823,13 @@ memfs-or-file-map-to-github-branch@^1.3.0:
6823
6823
dependencies :
6824
6824
" @octokit/rest" " *"
6825
6825
6826
+ memfs@^4.7.7 :
6827
+ version "4.7.7"
6828
+ resolved "https://registry.yarnpkg.com/memfs/-/memfs-4.7.7.tgz#bcf09cab1646d655f659e7cf832dfc75ccb95b2d"
6829
+ integrity sha512-x9qc6k88J/VVwnfTkJV8pRRswJ2156Rc4w5rciRqKceFDZ0y1MqsNL9pkg5sE0GOcDzZYbonreALhaHzg1siFw==
6830
+ dependencies :
6831
+ tslib "^2.0.0"
6832
+
6826
6833
memoize-one@^5.0.0 :
6827
6834
version "5.2.1"
6828
6835
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"
6920
6927
nullthrows "^1.1.1"
6921
6928
walker "^1.0.7"
6922
6929
6923
- metro-memory-fs@^0.82.5 :
6924
- version "0.82.5"
6925
- resolved "https://registry.yarnpkg.com/metro-memory-fs/-/metro-memory-fs-0.82.5.tgz#ae6c4c251cd6dc9cf44540c3b1356cff54db875e"
6926
- integrity sha512-yMYtBwDtG84vnDfQDEGZ3EUYbHng4dMZX2AKSQFQOMdd34lyQcD1yV5yrrUTG/DqMKDxJGqmxDkeyqTlKwwuUA==
6927
- dependencies :
6928
- flow-enums-runtime "^0.0.6"
6929
-
6930
6930
6931
6931
version "0.82.5"
6932
6932
resolved "https://registry.yarnpkg.com/metro-minify-terser/-/metro-minify-terser-0.82.5.tgz#5dc77d53b6ef4079bd9c752ae046d557df4ae584"
@@ -9191,6 +9191,11 @@ tslib@^1.8.1, tslib@^1.9.0:
9191
9191
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
9192
9192
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
9193
9193
9194
+ tslib@^2.0.0 :
9195
+ version "2.8.1"
9196
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
9197
+ integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
9198
+
9194
9199
tslib@^2.1.0 :
9195
9200
version "2.7.0"
9196
9201
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01"
You can’t perform that action at this time.
0 commit comments