test: add standalone area fixtures
This commit is contained in:
27
test/fixtures.js
Normal file
27
test/fixtures.js
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
const assert = require("assert/strict");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { compiler } = require("../src");
|
||||
|
||||
const root = path.resolve(__dirname, "..");
|
||||
for (const areaId of ["fengshu-er-road", "nantaizi-lake-innovation-valley"]) {
|
||||
const isFengshu = areaId === "fengshu-er-road";
|
||||
const outputRoot = path.join(root, "outputs", areaId);
|
||||
const input = {
|
||||
areaId,
|
||||
osmFile: path.join(root, "inputs", "osm", isFengshu ? "枫树二路.osm" : "南台子湖创新谷OSM.osm"),
|
||||
outDir: path.join(outputRoot, "native-road"),
|
||||
stagingDir: path.join(outputRoot, "_pipeline"),
|
||||
overridesFile: path.join(outputRoot, "native-road-overrides.json"),
|
||||
trafficSignalsFile: path.join(outputRoot, "native-traffic-signals.json"),
|
||||
comparisonDir: path.join(outputRoot, "osm2streets_web_out"),
|
||||
options: { edgeLines: false, junctionTemplates: { enabled: false, references: [] } },
|
||||
};
|
||||
assert.ok(fs.existsSync(path.join(root, "test", "baseline", `${areaId}.json`)));
|
||||
const { result } = compiler.compileInput(input);
|
||||
assert.equal(result.areaId, areaId);
|
||||
assert.ok(fs.existsSync(path.join(input.outDir, "compiled.json")));
|
||||
}
|
||||
console.log("road compiler fixture tests passed");
|
||||
Reference in New Issue
Block a user