From a6411707e11122a036c743d227415e08a40e3527 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 28 Apr 2022 23:30:49 +0200 Subject: [PATCH] =?UTF-8?q?DB=20E2E=20test:=20cleanup=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/db.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/e2e/db.js b/test/e2e/db.js index 7625497f..41bc4981 100644 --- a/test/e2e/db.js +++ b/test/e2e/db.js @@ -45,11 +45,7 @@ const cfg = { maxLongitude: 16.180237 } -const validateStation = createValidateStation(cfg) - -const validate = createValidate(cfg, { - station: validateStation -}) +const validate = createValidate(cfg) const assertValidPrice = (t, p) => { t.ok(p) @@ -317,12 +313,16 @@ tap.test('trip details', async (t) => { const tripRes = await client.trip(p.tripId, p.line.name, {when}) - const validateTrip = createValidateTrip(cfg) const validate = createValidate(cfg, { - trip: (validate, trip, name) => { - trip = Object.assign({}, trip) - if (!trip.direction) trip.direction = 'foo' // todo, see #49 - validateTrip(validate, trip, name) + trip: (cfg) => { + const validateTrip = createValidateTrip(cfg) + const validateTripWithFakeDirection = (val, trip, name) => { + validateTrip(val, { + ...trip, + direction: trip.direction || 'foo', // todo, see #49 + }, name) + } + return validateTripWithFakeDirection } }) validate(t, tripRes, 'tripResult', 'tripRes')