File tree 3 files changed +242
-234
lines changed
3 files changed +242
-234
lines changed Original file line number Diff line number Diff line change 18
18
import JSDOMEnvironment from 'jest-environment-jsdom' ;
19
19
20
20
/**
21
- * JSDOMEnvironment patch to polyfill missing fetch with native
22
- * Node fetch
21
+ * JSDOMEnvironment patch to polyfill missing APIs with Node APIs.
23
22
*/
24
23
// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
25
24
export default class FixJSDOMEnvironment extends JSDOMEnvironment {
26
25
constructor ( ...args : ConstructorParameters < typeof JSDOMEnvironment > ) {
27
26
super ( ...args ) ;
28
27
29
- // FIXME https://github.com/jsdom/jsdom/issues/1724
28
+ // Fetch
29
+ // FIXME: https://github.com/jsdom/jsdom/issues/1724
30
30
this . global . fetch = fetch ;
31
31
this . global . Headers = Headers ;
32
32
this . global . Request = Request ;
33
33
this . global . Response = Response ;
34
+
35
+ // Util
36
+ this . global . TextEncoder = TextEncoder ;
34
37
}
35
38
}
Original file line number Diff line number Diff line change 4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
- "setup" : " node test-setup.js" ,
8
7
"test" : " yarn jest" ,
9
8
"test:compat" : " yarn jest tests/compat.test.ts" ,
10
9
"test:modular" : " yarn jest tests/modular.test.ts" ,
18
17
"author" : " " ,
19
18
"license" : " ISC" ,
20
19
"dependencies" : {
21
- "firebase" : " 11.0.2 "
20
+ "firebase" : " 11.3.0 "
22
21
},
23
22
"devDependencies" : {
24
23
"@babel/core" : " 7.26.0" ,
You can’t perform that action at this time.
0 commit comments