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.

28 lines (27 loc) 1.32 kB
import { MissionListParser } from "../Aerofly/MissionsList.js"; import { Test } from "../Cli/Test.js"; import * as fs from "node:fs"; export class MissionListTest extends Test { constructor(process, dieOnError = false) { super(process, dieOnError); this.process = process; this.dieOnError = dieOnError; this.group(MissionListParser.name); { const fileContent = fs.readFileSync("./src/Tests/fixtures/kclm_kbli.tmc", "utf8"); const missionListParser = new MissionListParser(fileContent); const missionNames = missionListParser.getMissionNames(); this.assertEquals(missionNames.length, 2); this.assertEquals(missionNames[0], "From KCLM to KBLI"); this.assertEquals(missionNames[1], "Mount Teide awaits"); const missons = missionListParser.getMissions(); this.assertEquals(missons.length, 2); let mission = missionListParser.getMissionString(0); this.assert(mission !== "", "Mission not empty"); mission = missionListParser.getMissionString(1); this.assert(mission !== "", "Mission not empty"); mission = missionListParser.getMissionString(2); this.assert(mission === "", "Mission empty"); } } }