forked from MapComplete/MapComplete
Add workaround for turf.intersect which can't deal with touching polygons
This commit is contained in:
parent
d7d60da148
commit
92c63560ef
5 changed files with 2077 additions and 1827 deletions
|
@ -1,9 +1,9 @@
|
|||
export default class T {
|
||||
|
||||
public readonly name: string;
|
||||
private readonly _tests: [string, (() => void)][];
|
||||
private readonly _tests: [string, (() => (void | Promise<void>))][];
|
||||
|
||||
constructor(testsuite: string, tests: [string, () => void][]) {
|
||||
constructor(testsuite: string, tests: [string, () => (Promise<void> | void)][]) {
|
||||
this.name = testsuite
|
||||
this._tests = tests;
|
||||
}
|
||||
|
@ -60,7 +60,14 @@ export default class T {
|
|||
const failures: { testsuite: string, name: string, msg: string } [] = []
|
||||
for (const [name, test] of this._tests) {
|
||||
try {
|
||||
test();
|
||||
const r = test()
|
||||
if (r instanceof Promise) {
|
||||
r.catch(e => {
|
||||
console.log("ASYNC ERROR: ", e, e.stack)
|
||||
failures.push({testsuite: this.name, name: name, msg: "" + e});
|
||||
});
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.log("ERROR: ", e, e.stack)
|
||||
failures.push({testsuite: this.name, name: name, msg: "" + e});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue