UNPKG

random-flight-generator

Version:
35 lines (34 loc) 1.27 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = __importDefault(require("../index")); describe('RandomFlightGenerator', function () { it('should take FlightGeneratorOptions and return a flight when valid', function () { var options = { minDistance: 5, maxDistance: 100, }; var result = index_1.default(options).toJson(); expect(result.isValid).toBe(true); }); it('should take FlightGeneratorOptions and return a flight when valid', function () { var options = { minDistance: 5, maxDistance: 100, includeCountries: ['BR'], }; var result = index_1.default(options).toJson(); expect(result.departure.country).toBe('Brazil'); }); it('should take FlightGeneratorOptions and return an erro when invalid', function () { var options = { minDistance: 500, maxDistance: 100, }; expect(function () { index_1.default(options); }).toThrow(); }); });