Closed BertoCruz closed 2 years ago
mockTravelerData.js
http://localhost:3001/api/v1/travelers
export default mockTravelerData;
traveler-test.js
let traveler = new Traveler(travelersData);
Traveler.js
export default Traveler
getFirstName(){ return this.name.split(" ")[0];}
travelers: [ { id: 1, name: "Ham Leadbeater", travelerType: "relaxer" }, { id: 2, name: "Rachael Vaughten", travelerType: "thrill-seeker" }, ]
Traveler Class
Create mock travelers data testing suite:
mockTravelerData.js
filehttp://localhost:3001/api/v1/travelers
API endpointexport default mockTravelerData;
Create the Traveler Test file
traveler-test.js
Create new Traveler
let traveler = new Traveler(travelersData);
Traveler.js
class fileexport default Traveler
Properties:
Methods:
getFirstName(){ return this.name.split(" ")[0];}
Data Example: