mapcomplete/test/OsmObject.spec.ts

28 lines
733 B
TypeScript
Raw Normal View History

2021-06-28 18:06:54 +02:00
import T from "./TestHelper";
import {OsmObject} from "../Logic/Osm/OsmObject";
export default class OsmObjectSpec extends T {
constructor() {
super("osmobject", [
2021-06-28 18:06:54 +02:00
[
"Download referencing ways",
() => {
2021-11-07 16:34:51 +01:00
OsmObjectSpec.runTest().then(_ => console.log("Referencing ways test is done (async)"))
2021-06-28 18:06:54 +02:00
}
]
]);
}
2021-11-07 16:34:51 +01:00
private static async runTest() {
const ways = await OsmObject.DownloadReferencingWays("node/1124134958")
if (ways === undefined) {
throw "Did not get the ways"
}
if (ways.length !== 4) {
throw "Expected 4 ways but got " + ways.length
}
}
2021-06-28 18:06:54 +02:00
}