forked from MapComplete/MapComplete
Fix #343, add the poss^Cility to use the test backend (WIP), improve testability of OsmConnection (WIP)
This commit is contained in:
parent
8d404b1ba9
commit
9458128ccf
7 changed files with 138 additions and 42 deletions
|
@ -9,7 +9,26 @@ import TagQuestionSpec from "./TagQuestion.spec";
|
|||
import ImageSearcherSpec from "./ImageSearcher.spec";
|
||||
import ThemeSpec from "./Theme.spec";
|
||||
import UtilsSpec from "./Utils.spec";
|
||||
import OsmConnectionSpec from "./OsmConnection.spec";
|
||||
import T from "./TestHelper";
|
||||
import {FixedUiElement} from "../UI/Base/FixedUiElement";
|
||||
import Combine from "../UI/Base/Combine";
|
||||
|
||||
export default class TestAll {
|
||||
private needsBrowserTests: T[] = [new OsmConnectionSpec()]
|
||||
|
||||
public testAll(): void {
|
||||
Utils.runningFromConsole = false
|
||||
for (const test of this.needsBrowserTests.concat(allTests)) {
|
||||
if (test.failures.length > 0) {
|
||||
new Combine([new FixedUiElement("TEST FAILED: " + test.name).SetStyle("background: red"),
|
||||
...test.failures])
|
||||
.AttachTo("maindiv")
|
||||
throw "Some test failed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const allTests = [
|
||||
new TagSpec(),
|
||||
|
@ -20,8 +39,9 @@ const allTests = [
|
|||
new ThemeSpec(),
|
||||
new UtilsSpec()]
|
||||
|
||||
|
||||
for (const test of allTests) {
|
||||
if(test.failures.length > 0){
|
||||
if (test.failures.length > 0) {
|
||||
throw "Some test failed"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue