All files / api/trimet-client/src/fixture index.ts

100% Statements 12/12
100% Branches 0/0
100% Functions 2/2
100% Lines 12/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94                    1x                 1x               1x                 1x             1x       1x         1x             1x                 1x                 1x                 1x         1x    
import { ArrivalData, ArrivalLocation } from "../interfaces/arrivals";
import {
  Direction,
  StopData,
  StopLocation,
  TrimetRoute
} from "../interfaces/types";
import { arrival1, arrival2, arrival3 } from "./arrival";
 
export function arrivalsFixtureData(): Promise<ArrivalData> {
  const location1: ArrivalLocation = {
    desc: "Description",
    dir: "direction",
    id: 123,
    lat: 0,
    lng: 0,
 
    passengerCode: "E"
  };
  const location2: ArrivalLocation = {
    desc: "Description",
    dir: "direction",
    id: 456,
    lat: 0,
    lng: 0,
    passengerCode: "E"
  };
  const location3: ArrivalLocation = {
    desc: "Description",
    dir: "direction",
    id: 789,
    lat: 0,
    lng: 0,
    passengerCode: "E"
  };
 
  const arrivalData: ArrivalData = {
    arrival: [arrival1, arrival2, arrival3],
    detour: [],
    location: [location1, location2, location3],
    queryTime: "123"
  };
 
  return Promise.resolve(arrivalData);
}
 
export function stopFixtureData(): Promise<StopData> {
  const direction1: Direction = {
    desc: "foo",
    dir: 465
  };
 
  const route1: TrimetRoute = {
    desc: "string",
    dir: [direction1],
    route: 9101,
    type: "string"
  };
 
  const stopLocation1: StopLocation = {
    desc: "string",
    dir: "string",
    lat: 123,
    lng: 123,
    locid: 123,
    route: [route1]
  };
 
  const stopLocation2: StopLocation = {
    desc: "string",
    dir: "string",
    lat: 123,
    lng: 123,
    locid: 456,
    route: [route1]
  };
 
  const stopLocation3: StopLocation = {
    desc: "string",
    dir: "string",
    lat: 123,
    lng: 123,
    locid: 789,
    route: [route1]
  };
 
  const stopData: StopData = {
    location: [stopLocation1, stopLocation2, stopLocation3],
    queryTime: "123"
  };
 
  return Promise.resolve(stopData);
}