random-flight-generator
Version:
A tool for generating random flights.
35 lines (34 loc) • 1.27 kB
JavaScript
;
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();
});
});