mapcomplete/test/OsmObject.spec.ts

32 lines
948 B
TypeScript
Raw Normal View History

2021-06-28 18:06:54 +02:00
import T from "./TestHelper";
import {OsmObject} from "../Logic/Osm/OsmObject";
import ScriptUtils from "../scripts/ScriptUtils";
export default class OsmObjectSpec extends T {
constructor() {
super("OsmObject", [
[
"Download referencing ways",
() => {
let downloaded = false;
2021-07-03 21:39:30 +02:00
OsmObject.DownloadReferencingWays("node/1124134958").addCallbackAndRunD(ways => {
2021-06-28 18:06:54 +02:00
downloaded = true;
console.log(ways)
})
let timeout = 10
while (!downloaded && timeout >= 0) {
ScriptUtils.sleep(1000)
timeout--;
}
if (!downloaded) {
2021-06-28 18:06:54 +02:00
throw "Timeout: referencing ways not found"
}
}
]
]);
}
}