| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | import ScriptUtils from "../scripts/ScriptUtils" | 
					
						
							|  |  |  | import { Utils } from "../Utils" | 
					
						
							| 
									
										
										
										
											2022-06-28 03:21:18 +02:00
										 |  |  | import * as fakedom from "fake-dom" | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | import Locale from "../UI/i18n/Locale" | 
					
						
							| 
									
										
										
										
											2023-02-03 04:48:32 +01:00
										 |  |  | import { beforeEach } from "vitest" | 
					
						
							| 
									
										
										
										
											2023-02-09 00:10:59 +01:00
										 |  |  | import { ReferencingWaysMetaTagger } from "../Logic/SimpleMetaTagger" | 
					
						
							| 
									
										
										
										
											2022-03-23 19:48:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-03 04:48:32 +01:00
										 |  |  | beforeEach(async () => { | 
					
						
							|  |  |  |     ScriptUtils.fixUtils() | 
					
						
							|  |  |  |     Locale.language.setData("en") | 
					
						
							| 
									
										
										
										
											2023-02-09 00:10:59 +01:00
										 |  |  |     ReferencingWaysMetaTagger.enabled = false | 
					
						
							| 
									
										
										
										
											2023-02-03 04:48:32 +01:00
										 |  |  |     if (fakedom === undefined || window === undefined) { | 
					
						
							|  |  |  |         throw "FakeDom not initialized" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-06-28 03:21:18 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-03 04:48:32 +01:00
										 |  |  |     // Block internet access
 | 
					
						
							|  |  |  |     Utils.externalDownloadFunction = async (url) => { | 
					
						
							|  |  |  |         throw "Fetching " + url + "blocked in tests, use Utils.injectJsonDownloadForTests instead" | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | }) |