| 
									
										
										
										
											2021-09-09 00:05:51 +02:00
										 |  |  | import {Utils} from "../Utils"; | 
					
						
							| 
									
										
										
										
											2021-09-09 00:19:39 +02:00
										 |  |  | Utils.runningFromConsole = true; | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  | import TagSpec from "./Tag.spec"; | 
					
						
							|  |  |  | import ImageAttributionSpec from "./ImageAttribution.spec"; | 
					
						
							|  |  |  | import GeoOperationsSpec from "./GeoOperations.spec"; | 
					
						
							|  |  |  | import ImageSearcherSpec from "./ImageSearcher.spec"; | 
					
						
							|  |  |  | import ThemeSpec from "./Theme.spec"; | 
					
						
							|  |  |  | import UtilsSpec from "./Utils.spec"; | 
					
						
							| 
									
										
										
										
											2021-06-08 16:52:31 +02:00
										 |  |  | import OsmConnectionSpec from "./OsmConnection.spec"; | 
					
						
							|  |  |  | import T from "./TestHelper"; | 
					
						
							|  |  |  | import {FixedUiElement} from "../UI/Base/FixedUiElement"; | 
					
						
							|  |  |  | import Combine from "../UI/Base/Combine"; | 
					
						
							| 
									
										
										
										
											2021-06-28 18:06:54 +02:00
										 |  |  | import OsmObjectSpec from "./OsmObject.spec"; | 
					
						
							|  |  |  | import ScriptUtils from "../scripts/ScriptUtils"; | 
					
						
							| 
									
										
										
										
											2021-07-04 20:36:19 +02:00
										 |  |  | import UnitsSpec from "./Units.spec"; | 
					
						
							| 
									
										
										
										
											2021-06-28 18:06:54 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 16:52:31 +02:00
										 |  |  | export default class TestAll { | 
					
						
							|  |  |  |     private needsBrowserTests: T[] = [new OsmConnectionSpec()] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public testAll(): void { | 
					
						
							|  |  |  |         Utils.runningFromConsole = false | 
					
						
							|  |  |  |         for (const test of this.needsBrowserTests.concat(allTests)) { | 
					
						
							|  |  |  |             if (test.failures.length > 0) { | 
					
						
							|  |  |  |                 new Combine([new FixedUiElement("TEST FAILED: " + test.name).SetStyle("background: red"), | 
					
						
							|  |  |  |                     ...test.failures]) | 
					
						
							|  |  |  |                     .AttachTo("maindiv") | 
					
						
							|  |  |  |                 throw "Some test failed" | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-28 18:06:54 +02:00
										 |  |  | ScriptUtils.fixUtils() | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  | const allTests = [ | 
					
						
							| 
									
										
										
										
											2021-06-28 18:06:54 +02:00
										 |  |  |     new OsmObjectSpec(), | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  |     new TagSpec(), | 
					
						
							|  |  |  |     new ImageAttributionSpec(), | 
					
						
							|  |  |  |     new GeoOperationsSpec(), | 
					
						
							|  |  |  |     new ImageSearcherSpec(), | 
					
						
							|  |  |  |     new ThemeSpec(), | 
					
						
							| 
									
										
										
										
											2021-07-04 20:36:19 +02:00
										 |  |  |     new UtilsSpec(), | 
					
						
							|  |  |  |     new UnitsSpec() | 
					
						
							| 
									
										
										
										
											2021-06-22 00:29:07 +02:00
										 |  |  | ] | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 16:52:31 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  | for (const test of allTests) { | 
					
						
							| 
									
										
										
										
											2021-06-08 16:52:31 +02:00
										 |  |  |     if (test.failures.length > 0) { | 
					
						
							| 
									
										
										
										
											2021-09-09 00:05:51 +02:00
										 |  |  |         throw "Some test failed: " + test.failures.join(", ") | 
					
						
							| 
									
										
										
										
											2021-05-14 02:25:30 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } |