Compare commits

...

2 commits

Author SHA1 Message Date
Traines
a504902bf5 e2e CI is probably blocked, disabling it
Some checks failed
test / lint-and-spellcheck (push) Has been cancelled
test / unit-tests (18.x) (push) Has been cancelled
test / unit-tests (20.x) (push) Has been cancelled
test / unit-tests (22.x) (push) Has been cancelled
test / integration-tests (18.x) (push) Has been cancelled
test / integration-tests (20.x) (push) Has been cancelled
test / integration-tests (22.x) (push) Has been cancelled
2026-04-26 10:33:42 +00:00
dabund24
b935802f4e
fix dbweb options possibly being null (#47)
* fix `maxUmstiege` option possibly being `null` for `dbweb` profile

* fix `zwischenhalte` option possibly being `null` for `dbweb` profile

* update `dbweb` integration test fixtures
2026-04-26 12:24:27 +02:00
7 changed files with 2503 additions and 385 deletions

View file

@ -76,26 +76,26 @@ jobs:
- run: npm run test-integration - run: npm run test-integration
e2e-tests: # e2e-tests:
needs: [unit-tests, integration-tests] # needs: [unit-tests, integration-tests]
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
node-version: [18.x] # node-version: [18.x]
steps: # steps:
- name: checkout # - name: checkout
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: setup Node.js v${{ matrix.node-version }} # - name: setup Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4 # uses: actions/setup-node@v4
with: # with:
node-version: ${{ matrix.node-version }} # node-version: ${{ matrix.node-version }}
#
- id: cache-npm # - id: cache-npm
name: restore npm cache # name: restore npm cache
uses: actions/cache@v4 # uses: actions/cache@v4
with: # with:
key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-e2e-tests # key: npm-cache-${{ github.ref_name }}-${{ matrix.node-version }}-e2e-tests
path: ${{ env.npm_config_cache }} # path: ${{ env.npm_config_cache }}
- run: npm install # - run: npm install
#
- run: npm run test-e2e # - run: npm run test-e2e

View file

@ -1,5 +1,5 @@
const formatTransfers = (transfers) => { const formatTransfers = (transfers) => {
if (transfers === -1) { // profiles may not accept -1: https://github.com/public-transport/db-vendo-client/issues/5 if (transfers === null || transfers === -1) { // profiles may not accept -1: https://github.com/public-transport/db-vendo-client/issues/5
return undefined; return undefined;
} }
return transfers; return transfers;

View file

@ -18,7 +18,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
abfahrtsHalt: from.lid, abfahrtsHalt: from.lid,
zwischenhalte: opt.via zwischenhalte: opt.via
? [{id: profile.formatLocation(profile, opt.via, 'opt.via').lid}] ? [{id: profile.formatLocation(profile, opt.via, 'opt.via').lid}]
: null, : undefined,
ankunftsHalt: to.lid, ankunftsHalt: to.lid,
produktgattungen: filters, produktgattungen: filters,
bikeCarriage: opt.bike, bikeCarriage: opt.bike,

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "db-vendo-client", "name": "db-vendo-client",
"version": "6.10.8", "version": "6.10.9",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "db-vendo-client", "name": "db-vendo-client",
"version": "6.10.8", "version": "6.10.9",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"content-type": "^1.0.5", "content-type": "^1.0.5",

View file

@ -1,7 +1,7 @@
{ {
"name": "db-vendo-client", "name": "db-vendo-client",
"description": "Client for bahn.de public transport APIs.", "description": "Client for bahn.de public transport APIs.",
"version": "6.10.8", "version": "6.10.9",
"type": "module", "type": "module",
"main": "index.js", "main": "index.js",
"files": [ "files": [

View file

@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o); const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
const minute = 60 * 1000; const minute = 60 * 1000;
const T_MOCK = 1747040400 * 1000; // 2025-05-12T08:00:00+01:00 const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK); const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
const cfg = { const cfg = {
@ -127,7 +127,7 @@ if (!process.env.VCR_OFF) {
}); });
tap.test('refreshJourney valid tickets', async (t) => { tap.test('refreshJourney valid tickets', async (t) => {
const T_MOCK = 1710831600 * 1000; // 2024-03-19T08:00:00+01:00 const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK); const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
const journeysRes = await client.journeys(berlinHbf, münchenHbf, { const journeysRes = await client.journeys(berlinHbf, münchenHbf, {
@ -261,7 +261,7 @@ if (!process.env.VCR_OFF) {
} }
tap.test('refreshJourney', async (t) => { tap.test('refreshJourney', async (t) => {
const T_MOCK = 1710831600 * 1000; // 2024-03-19T08:00:00+01:00 const T_MOCK = 1779714000 * 1000; // 2026-05-25T15:00:00+02:00
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK); const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
const validate = createValidate({...cfg, when}); const validate = createValidate({...cfg, when});

File diff suppressed because one or more lines are too long