mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
move profile E2E tests to test/e2e
This commit is contained in:
parent
0165320808
commit
9318007455
36 changed files with 64 additions and 63 deletions
|
@ -64,7 +64,8 @@
|
||||||
"vbb-stations-autocomplete": "^4.1.0"
|
"vbb-stations-autocomplete": "^4.1.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "env NODE_ENV=dev node test/index.js",
|
"e2e-test": "env NODE_ENV=dev node test/e2e/index.js | tap-spec",
|
||||||
"prepublishOnly": "npm test | tap-spec"
|
"test": "npm run e2e-test",
|
||||||
|
"prepublishOnly": "npm test"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@ const isRoughlyEqual = require('is-roughly-equal')
|
||||||
const {DateTime} = require('luxon')
|
const {DateTime} = require('luxon')
|
||||||
const flatMap = require('lodash/flatMap')
|
const flatMap = require('lodash/flatMap')
|
||||||
|
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const bvgProfile = require('../p/bvg')
|
const bvgProfile = require('../../p/bvg')
|
||||||
const products = require('../p/bvg/products')
|
const products = require('../../p/bvg/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const {
|
const {
|
||||||
cfg,
|
cfg,
|
|
@ -6,9 +6,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const cflProfile = require('../p/cfl')
|
const cflProfile = require('../../p/cfl')
|
||||||
const products = require('../p/cfl/products')
|
const products = require('../../p/cfl/products')
|
||||||
const {
|
const {
|
||||||
line: createValidateLine,
|
line: createValidateLine,
|
||||||
journeyLeg: createValidateJourneyLeg,
|
journeyLeg: createValidateJourneyLeg,
|
|
@ -5,9 +5,9 @@ const tapePromise = require('tape-promise').default
|
||||||
const tape = require('tape')
|
const tape = require('tape')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const cmtaProfile = require('../p/cmta')
|
const cmtaProfile = require('../../p/cmta')
|
||||||
const products = require('../p/cmta/products')
|
const products = require('../../p/cmta/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
||||||
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
const test = require('tape')
|
const test = require('tape')
|
||||||
|
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const vbbProfile = require('../p/vbb')
|
const vbbProfile = require('../../p/vbb')
|
||||||
const parseDateTime = require('../parse/date-time')
|
const parseDateTime = require('../../parse/date-time')
|
||||||
|
|
||||||
// todo: use a mock profile
|
// todo: use a mock profile
|
||||||
const client = createClient(vbbProfile, 'public-transport/hafas-client:test')
|
const client = createClient(vbbProfile, 'public-transport/hafas-client:test')
|
|
@ -5,12 +5,11 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const dbBusradarNrwProfile = require('../p/db-busradar-nrw')
|
const dbBusradarNrwProfile = require('../../p/db-busradar-nrw')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testDepartures = require('./lib/departures')
|
const testDepartures = require('./lib/departures')
|
||||||
const testArrivals = require('./lib/arrivals')
|
const testArrivals = require('./lib/arrivals')
|
||||||
// const testJourneysWithDetour = require('./lib/journeys-with-detour')
|
|
||||||
|
|
||||||
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o)
|
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o)
|
||||||
|
|
|
@ -7,9 +7,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const dbProfile = require('../p/db')
|
const dbProfile = require('../../p/db')
|
||||||
const products = require('../p/db/products')
|
const products = require('../../p/db/products')
|
||||||
const {
|
const {
|
||||||
station: createValidateStation,
|
station: createValidateStation,
|
||||||
trip: createValidateTrip
|
trip: createValidateTrip
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const hvvProfile = require('../p/hvv')
|
const hvvProfile = require('../../p/hvv')
|
||||||
const products = require('../p/hvv/products')
|
const products = require('../../p/hvv/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
||||||
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
16
test/e2e/index.js
Normal file
16
test/e2e/index.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
require('./common')
|
||||||
|
require('./db')
|
||||||
|
require('./vbb')
|
||||||
|
require('./bvg')
|
||||||
|
require('./oebb')
|
||||||
|
require('./insa')
|
||||||
|
require('./nahsh')
|
||||||
|
require('./cmta')
|
||||||
|
require('./nvv')
|
||||||
|
require('./sbahn-muenchen')
|
||||||
|
require('./saarfahrplan')
|
||||||
|
require('./cfl')
|
||||||
|
require('./hvv')
|
||||||
|
require('./db-busradar-nrw')
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const insaProfile = require('../p/insa')
|
const insaProfile = require('../../p/insa')
|
||||||
const products = require('../p/insa/products')
|
const products = require('../../p/insa/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
||||||
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
|
@ -3,7 +3,7 @@
|
||||||
const stations = require('vbb-stations-autocomplete')
|
const stations = require('vbb-stations-autocomplete')
|
||||||
const a = require('assert')
|
const a = require('assert')
|
||||||
const shorten = require('vbb-short-station-name')
|
const shorten = require('vbb-short-station-name')
|
||||||
const products = require('../../p/bvg/products')
|
const products = require('../../../p/bvg/products')
|
||||||
|
|
||||||
const {createWhen} = require('./util')
|
const {createWhen} = require('./util')
|
||||||
const {
|
const {
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const nahshProfile = require('../p/nahsh')
|
const nahshProfile = require('../../p/nahsh')
|
||||||
const products = require('../p/nahsh/products')
|
const products = require('../../p/nahsh/products')
|
||||||
const {
|
const {
|
||||||
line: createValidateLine,
|
line: createValidateLine,
|
||||||
station: createValidateStation
|
station: createValidateStation
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const nvvProfile = require('../p/nvv')
|
const nvvProfile = require('../../p/nvv')
|
||||||
const products = require('../p/nvv/products')
|
const products = require('../../p/nvv/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
||||||
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
|
@ -6,9 +6,9 @@ const isRoughlyEqual = require('is-roughly-equal')
|
||||||
const validateLine = require('validate-fptf/line')
|
const validateLine = require('validate-fptf/line')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const oebbProfile = require('../p/oebb')
|
const oebbProfile = require('../../p/oebb')
|
||||||
const products = require('../p/oebb/products')
|
const products = require('../../p/oebb/products')
|
||||||
const {
|
const {
|
||||||
station: createValidateStation,
|
station: createValidateStation,
|
||||||
stop: validateStop
|
stop: validateStop
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const { createWhen } = require('./lib/util')
|
const { createWhen } = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const saarfahrplanProfile = require('../p/saarfahrplan')
|
const saarfahrplanProfile = require('../../p/saarfahrplan')
|
||||||
const products = require('../p/saarfahrplan/products')
|
const products = require('../../p/saarfahrplan/products')
|
||||||
const {
|
const {
|
||||||
station: createValidateStation,
|
station: createValidateStation,
|
||||||
stop: validateStop
|
stop: validateStop
|
|
@ -5,9 +5,9 @@ const tapePromise = require('tape-promise').default
|
||||||
const tape = require('tape')
|
const tape = require('tape')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const sMunichProfile = require('../p/sbahn-muenchen')
|
const sMunichProfile = require('../../p/sbahn-muenchen')
|
||||||
const products = require('../p/sbahn-muenchen/products')
|
const products = require('../../p/sbahn-muenchen/products')
|
||||||
const {movement: _validateMovement} = require('./lib/validators')
|
const {movement: _validateMovement} = require('./lib/validators')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
|
@ -3,9 +3,9 @@
|
||||||
const tapePromise = require('tape-promise').default
|
const tapePromise = require('tape-promise').default
|
||||||
const tape = require('tape')
|
const tape = require('tape')
|
||||||
|
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const vbbProfile = require('../p/vbb')
|
const vbbProfile = require('../../p/vbb')
|
||||||
const products = require('../p/vbb/products')
|
const products = require('../../p/vbb/products')
|
||||||
const {
|
const {
|
||||||
cfg,
|
cfg,
|
||||||
validateStation,
|
validateStation,
|
|
@ -5,9 +5,9 @@ const tape = require('tape')
|
||||||
const isRoughlyEqual = require('is-roughly-equal')
|
const isRoughlyEqual = require('is-roughly-equal')
|
||||||
|
|
||||||
const {createWhen} = require('./lib/util')
|
const {createWhen} = require('./lib/util')
|
||||||
const createClient = require('..')
|
const createClient = require('../..')
|
||||||
const vbnProfile = require('../p/vbn')
|
const vbnProfile = require('../../p/vbn')
|
||||||
const products = require('../p/vbn/products')
|
const products = require('../../p/vbn/products')
|
||||||
const createValidate = require('./lib/validate-fptf-with')
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
const testJourneysStationToStation = require('./lib/journeys-station-to-station')
|
||||||
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
|
@ -4,20 +4,5 @@ require('./bvg-journey')
|
||||||
require('./vbb-departures')
|
require('./vbb-departures')
|
||||||
require('./bvg-radar')
|
require('./bvg-radar')
|
||||||
|
|
||||||
require('./common')
|
|
||||||
require('./db')
|
|
||||||
require('./vbb')
|
|
||||||
require('./bvg')
|
|
||||||
require('./oebb')
|
|
||||||
require('./insa')
|
|
||||||
require('./nahsh')
|
|
||||||
require('./cmta')
|
|
||||||
require('./nvv')
|
|
||||||
require('./sbahn-muenchen')
|
|
||||||
require('./saarfahrplan')
|
|
||||||
require('./cfl')
|
|
||||||
require('./hvv')
|
|
||||||
require('./db-busradar-nrw')
|
|
||||||
|
|
||||||
require('./throttle')
|
require('./throttle')
|
||||||
require('./retry')
|
require('./retry')
|
||||||
|
|
Loading…
Add table
Reference in a new issue