File tree Expand file tree Collapse file tree 3 files changed +242
-234
lines changed Expand file tree Collapse file tree 3 files changed +242
-234
lines changed Original file line number Diff line number Diff line change 1818import JSDOMEnvironment from 'jest-environment-jsdom' ;
1919
2020/**
21- * JSDOMEnvironment patch to polyfill missing fetch with native
22- * Node fetch
21+ * JSDOMEnvironment patch to polyfill missing APIs with Node APIs.
2322 */
2423// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
2524export default class FixJSDOMEnvironment extends JSDOMEnvironment {
2625 constructor ( ...args : ConstructorParameters < typeof JSDOMEnvironment > ) {
2726 super ( ...args ) ;
2827
29- // FIXME https://github.com/jsdom/jsdom/issues/1724
28+ // Fetch
29+ // FIXME: https://github.com/jsdom/jsdom/issues/1724
3030 this . global . fetch = fetch ;
3131 this . global . Headers = Headers ;
3232 this . global . Request = Request ;
3333 this . global . Response = Response ;
34+
35+ // Util
36+ this . global . TextEncoder = TextEncoder ;
3437 }
3538}
Original file line number Diff line number Diff line change 44 "description" : " " ,
55 "main" : " index.js" ,
66 "scripts" : {
7- "setup" : " node test-setup.js" ,
87 "test" : " yarn jest" ,
98 "test:compat" : " yarn jest tests/compat.test.ts" ,
109 "test:modular" : " yarn jest tests/modular.test.ts" ,
1817 "author" : " " ,
1918 "license" : " ISC" ,
2019 "dependencies" : {
21- "firebase" : " 11.0.2 "
20+ "firebase" : " 11.3.0 "
2221 },
2322 "devDependencies" : {
2423 "@babel/core" : " 7.26.0" ,
You can’t perform that action at this time.
0 commit comments