mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2026-05-05 16:21:47 +03:00
Compare commits
No commits in common. "a504902bf504c330205aa8b174c70fe535adf8b2" and "a2e3a36e20e43494825345b09eca57abe3022eb7" have entirely different histories.
a504902bf5
...
a2e3a36e20
7 changed files with 385 additions and 2503 deletions
46
.github/workflows/test.yml
vendored
46
.github/workflows/test.yml
vendored
|
|
@ -76,26 +76,26 @@ jobs:
|
|||
|
||||
- run: npm run test-integration
|
||||
|
||||
# e2e-tests:
|
||||
# needs: [unit-tests, integration-tests]
|
||||
# runs-on: ubuntu-latest
|
||||
# strategy:
|
||||
# matrix:
|
||||
# node-version: [18.x]
|
||||
# steps:
|
||||
# - name: checkout
|
||||
# uses: actions/checkout@v4
|
||||
# - name: setup Node.js v${{ matrix.node-version }}
|
||||
# uses: actions/setup-node@v4
|
||||
# with:
|
||||
# node-version: ${{ matrix.node-version }}
|
||||
#
|
||||
# - id: cache-npm
|
||||
# name: restore npm cache
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-e2e-tests
|
||||
# path: ${{ env.npm_config_cache }}
|
||||
# - run: npm install
|
||||
#
|
||||
# - run: npm run test-e2e
|
||||
e2e-tests:
|
||||
needs: [unit-tests, integration-tests]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: setup Node.js v${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- id: cache-npm
|
||||
name: restore npm cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-e2e-tests
|
||||
path: ${{ env.npm_config_cache }}
|
||||
- run: npm install
|
||||
|
||||
- run: npm run test-e2e
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const formatTransfers = (transfers) => {
|
||||
if (transfers === null || transfers === -1) { // profiles may not accept -1: https://github.com/public-transport/db-vendo-client/issues/5
|
||||
if (transfers === -1) { // profiles may not accept -1: https://github.com/public-transport/db-vendo-client/issues/5
|
||||
return undefined;
|
||||
}
|
||||
return transfers;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
|
|||
abfahrtsHalt: from.lid,
|
||||
zwischenhalte: opt.via
|
||||
? [{id: profile.formatLocation(profile, opt.via, 'opt.via').lid}]
|
||||
: undefined,
|
||||
: null,
|
||||
ankunftsHalt: to.lid,
|
||||
produktgattungen: filters,
|
||||
bikeCarriage: opt.bike,
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "db-vendo-client",
|
||||
"version": "6.10.9",
|
||||
"version": "6.10.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "db-vendo-client",
|
||||
"version": "6.10.9",
|
||||
"version": "6.10.8",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "db-vendo-client",
|
||||
"description": "Client for bahn.de public transport APIs.",
|
||||
"version": "6.10.9",
|
||||
"version": "6.10.8",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
|
|||
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
|
||||
const minute = 60 * 1000;
|
||||
|
||||
const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
|
||||
const T_MOCK = 1747040400 * 1000; // 2025-05-12T08:00:00+01:00
|
||||
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
|
||||
|
||||
const cfg = {
|
||||
|
|
@ -127,7 +127,7 @@ if (!process.env.VCR_OFF) {
|
|||
});
|
||||
|
||||
tap.test('refreshJourney – valid tickets', async (t) => {
|
||||
const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
|
||||
const T_MOCK = 1710831600 * 1000; // 2024-03-19T08:00:00+01:00
|
||||
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
|
||||
|
||||
const journeysRes = await client.journeys(berlinHbf, münchenHbf, {
|
||||
|
|
@ -261,7 +261,7 @@ if (!process.env.VCR_OFF) {
|
|||
}
|
||||
|
||||
tap.test('refreshJourney', async (t) => {
|
||||
const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
|
||||
const T_MOCK = 1710831600 * 1000; // 2024-03-19T08:00:00+01:00
|
||||
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
|
||||
const validate = createValidate({...cfg, when});
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue