mapcomplete/test/testhooks.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
565 B
TypeScript
Raw Normal View History

2022-03-23 19:48:06 +01:00
import ScriptUtils from "../scripts/ScriptUtils"
2023-07-15 18:55:03 +02:00
import { Utils } from "../src/Utils"
import Locale from "../src/UI/i18n/Locale"
2023-02-03 04:48:32 +01:00
import { beforeEach } from "vitest"
2023-07-15 18:55:03 +02:00
import { ReferencingWaysMetaTagger } from "../src/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
// Block internet access
Utils.externalDownloadFunction = async (url) => {
2023-05-17 13:16:43 +02:00
throw "Fetching " + url + " blocked in tests, use Utils.injectJsonDownloadForTests instead"
2023-02-03 04:48:32 +01:00
}
})