20 lines
1.0 KiB
JavaScript
20 lines
1.0 KiB
JavaScript
"use strict";
|
|
|
|
const assert = require("assert/strict");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const compiler = require("../src");
|
|
|
|
assert.equal(typeof compiler.laneGeometry.laneCenterline, "function");
|
|
assert.equal(typeof compiler.gaodeReference.convertGeoJson, "function");
|
|
assert.equal(typeof compiler.turnLaneArrows.buildCustomTurnLaneArrows, "function");
|
|
assert.equal(typeof compiler.complexJunction.buildComplexJunctionGeometry, "function");
|
|
assert.equal(typeof compiler.nativeRoad.compileRoadModel, "function");
|
|
assert.equal(typeof compiler.check.checkOutput, "function");
|
|
const fixture = path.join(__dirname, "fixtures", "fengshu-er-road.osm");
|
|
assert.ok(fs.existsSync(fixture));
|
|
assert.throws(() => compiler.compiler.validateInput({ id: "area" }), /RoadCompilerInput/);
|
|
const model = compiler.nativeRoad.compileRoadModel(fs.readFileSync(fixture, "utf8"), { schema: "native-road-overrides/v1", overrides: [] });
|
|
assert.equal(model.roads.length, 24);
|
|
console.log("road compiler package tests passed");
|