forked from MapComplete/MapComplete
Further refactoring of the tests
This commit is contained in:
parent
3ab373f6ec
commit
2dac893bb3
31 changed files with 2498 additions and 2992 deletions
|
|
@ -1,45 +1,19 @@
|
|||
import GeoOperationsSpec from "./GeoOperations.spec";
|
||||
import OsmObjectSpec from "./OsmObject.spec";
|
||||
import ScriptUtils from "../scripts/ScriptUtils";
|
||||
import RelationSplitHandlerSpec from "./RelationSplitHandler.spec";
|
||||
import SplitActionSpec from "./SplitAction.spec";
|
||||
import {Utils} from "../Utils";
|
||||
import ImageProviderSpec from "./ImageProvider.spec";
|
||||
import ReplaceGeometrySpec from "./ReplaceGeometry.spec";
|
||||
import LegacyThemeLoaderSpec from "./LegacyThemeLoader.spec";
|
||||
import T from "./TestHelper";
|
||||
import CreateNoteImportLayerSpec from "./CreateNoteImportLayer.spec";
|
||||
import CreateCacheSpec from "./CreateCache.spec";
|
||||
import ImportMultiPolygonSpec from "./ImportMultiPolygon.spec";
|
||||
import ChangesetHandlerSpec from "./ChangesetHandler.spec";
|
||||
|
||||
|
||||
async function main() {
|
||||
|
||||
const allTests: T[] = [
|
||||
new ChangesetHandlerSpec(),
|
||||
new OsmObjectSpec(),
|
||||
new GeoOperationsSpec(),
|
||||
new RelationSplitHandlerSpec(),
|
||||
new SplitActionSpec(),
|
||||
new ImageProviderSpec(),
|
||||
new ReplaceGeometrySpec(),
|
||||
new LegacyThemeLoaderSpec(),
|
||||
new CreateNoteImportLayerSpec(),
|
||||
new CreateCacheSpec(),
|
||||
new ImportMultiPolygonSpec(),
|
||||
]
|
||||
ScriptUtils.fixUtils();
|
||||
const realDownloadFunc = Utils.externalDownloadFunction;
|
||||
|
||||
Utils.externalDownloadFunction = async (url) => {
|
||||
console.error("Fetching ", url, "blocked in tests, use Utils.injectJsonDownloadForTests")
|
||||
const data = await realDownloadFunc(url)
|
||||
console.log("\n\n ----------- \nBLOCKED DATA\n Utils.injectJsonDownloadForTests(\n" +
|
||||
" ", JSON.stringify(url), ", \n",
|
||||
" ", JSON.stringify(data), "\n )\n------------------\n\n")
|
||||
throw "Detected internet access for URL " + url + ", please inject it with Utils.injectJsonDownloadForTests"
|
||||
}
|
||||
|
||||
let args = [...process.argv]
|
||||
args.splice(0, 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue