This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ import * as languageHandler from "../../src/languageHandler";
20
20
import en from "../../src/i18n/strings/en_EN.json" ;
21
21
import de from "../../src/i18n/strings/de_DE.json" ;
22
22
23
- fetchMock . config . overwriteRoutes = false ;
24
- fetchMock . catch ( "" ) ;
25
- window . fetch = fetchMock . sandbox ( ) ;
26
-
27
23
const lv = {
28
24
"Save" : "Saglabāt" ,
29
25
"Uploading %(filename)s and %(count)s others|one" : "Качване на %(filename)s и %(count)s друг" ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
+ import fetchMock from "fetch-mock-jest" ;
17
18
import { TextDecoder , TextEncoder } from "util" ;
18
19
19
20
// jest 27 removes setImmediate from jsdom
@@ -54,3 +55,9 @@ global.TextDecoder = TextDecoder;
54
55
55
56
// prevent errors whenever a component tries to manually scroll.
56
57
window . HTMLElement . prototype . scrollIntoView = jest . fn ( ) ;
58
+
59
+ // set up fetch API mock
60
+ fetchMock . config . overwriteRoutes = false ;
61
+ fetchMock . catch ( "" ) ;
62
+ fetchMock . get ( "/image-file-stub" , "image file stub" ) ;
63
+ window . fetch = fetchMock . sandbox ( ) ;
You can’t perform that action at this time.
0 commit comments