UNPKG

aviation-model

Version:

Public methods for querying the information from aviation-pg

29 lines (22 loc) 819 B
"use strict"; var assert = require("assert"); var methods = require("../src/index.js"); var getAirlineCities = methods.getAirlineCities; var getCity = methods.getCity; var expectedDestinations = require("./fixtures/city_destinations_iberia.json"); describe("airport_cities model \n", function() { it("should return the requested city", function(done) { getCity("Alicante%E2%80%93Elche_Airport", function(err, city) { if (err) {throw err;} assert.equal(city, "Alicante"); done(); }); }); it("should return the list of cities where the airline is actually flying. ", function (done) { getAirlineCities("Iberia", function(err, cities) { if (err) {throw err; } assert.deepEqual(cities, expectedDestinations, "the cities have changed."); done(); }); }); });