UNPKG

aerofly-missions

Version:

The Aerofly Missionsgerät converts simulator flight plan files for Aerofly FS 4, Microsoft Flight Simulator, X-Plane, GeoFS, and Garmin / Infinite Flight flight plan files. It also imports SimBrief flight plans.

36 lines (35 loc) 1.82 kB
import { Test } from "../Cli/Test.js"; import { GeoJsonImport } from "../Import/GeoJson.js"; import * as fs from "node:fs"; export class GeoJsonImportTest extends Test { constructor(process, dieOnError = false) { super(process, dieOnError); this.process = process; this.dieOnError = dieOnError; this.group(GeoJsonImport.name); { const gpl = new GeoJsonImport(fs.readFileSync("./src/Tests/fixtures/reno-airrace.geojson", "utf8")); this.assertEquals(gpl.waypoints.length, 15); this.assertEquals(gpl.waypoints[0].identifier, "KRTS"); this.assertEquals(gpl.waypoints[0].type, "AIRPORT"); this.assertEquals(gpl.waypoints[1].type, "USER WAYPOINT"); this.assertEquals(gpl.waypoints[14].type, "AIRPORT"); this.assertEquals(gpl.waypoints[1].lat, 39.665246531929995); this.assertEquals(gpl.waypoints[4].lon, -119.8601888582547); this.assertEquals(gpl.cruisingAltFt, undefined); } this.group(GeoJsonImport.name + ": More complex"); { const gpl = new GeoJsonImport(fs.readFileSync("./src/Tests/fixtures/EGOV-EGOV.geojson", "utf8")); this.assertEquals(gpl.waypoints.length, 16); this.assertEquals(gpl.waypoints[0].identifier, "EGOV"); this.assertEquals(gpl.waypoints[15].identifier, "EGOV"); this.assertEquals(gpl.waypoints[0].type, "AIRPORT"); this.assertEquals(gpl.waypoints[1].type, "USER WAYPOINT"); this.assertEquals(gpl.waypoints[15].type, "AIRPORT"); this.assertEquals(gpl.waypoints[1].lat, 52.717475); this.assertEquals(gpl.waypoints[4].lon, -3.8810166666666666); this.assertEquals(gpl.cruisingAltFt, 2500); } } }