mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
tests: enable linter, fix code style
This commit is contained in:
parent
3c7d8f79b2
commit
dda36c2da0
5 changed files with 25 additions and 16 deletions
|
@ -9,7 +9,7 @@
|
||||||
"Atomics": "readonly",
|
"Atomics": "readonly",
|
||||||
"SharedArrayBuffer": "readonly"
|
"SharedArrayBuffer": "readonly"
|
||||||
},
|
},
|
||||||
"ignorePatterns": ["node_modules", "test", "*example.js"],
|
"ignorePatterns": ["node_modules", "*example.js"],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2018
|
"ecmaVersion": 2018
|
||||||
},
|
},
|
||||||
|
@ -22,5 +22,15 @@
|
||||||
"ignoreRestSiblings": false
|
"ignoreRestSiblings": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"test/**"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ const opt = {
|
||||||
results: 256,
|
results: 256,
|
||||||
duration: 30,
|
duration: 30,
|
||||||
frames: 3,
|
frames: 3,
|
||||||
products: null,
|
|
||||||
polylines: true,
|
polylines: true,
|
||||||
when: '2019-08-19T21:00:00+02:00',
|
when: '2019-08-19T21:00:00+02:00',
|
||||||
products: {}
|
products: {}
|
||||||
|
|
|
@ -32,7 +32,7 @@ const assertValidWhen = (actual, expected, name) => {
|
||||||
throw new AssertionError({
|
throw new AssertionError({
|
||||||
message: name + ' is out of range',
|
message: name + ' is out of range',
|
||||||
actual: ts,
|
actual: ts,
|
||||||
expected: `${expected - delta} - ${+expected + delta}`,
|
expected: `${expected - delta} - ${+expected + delta}`,
|
||||||
operator: 'isRoughlyEqual',
|
operator: 'isRoughlyEqual',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ const wienRenngasse = '1390186'
|
||||||
const wienKarlsplatz = '1390461'
|
const wienKarlsplatz = '1390461'
|
||||||
const wienPilgramgasse = '1390562'
|
const wienPilgramgasse = '1390562'
|
||||||
|
|
||||||
tap.test('journeys – Salzburg Hbf to Wien Westbahnhof', async (t) => {
|
tap.test('journeys – Salzburg Hbf to Wien Westbahnhof', async (t) => {
|
||||||
const res = await client.journeys(salzburgHbf, wienFickeystr, {
|
const res = await client.journeys(salzburgHbf, wienFickeystr, {
|
||||||
results: 4,
|
results: 4,
|
||||||
departure: when,
|
departure: when,
|
||||||
|
@ -88,7 +88,7 @@ tap.test('journeys – Salzburg Hbf to Wien Westbahnhof', async (t) => {
|
||||||
|
|
||||||
// todo: journeys, only one product
|
// todo: journeys, only one product
|
||||||
|
|
||||||
tap.test('journeys – fails with no product', (t) => {
|
tap.test('journeys – fails with no product', (t) => {
|
||||||
journeysFailsWithNoProduct({
|
journeysFailsWithNoProduct({
|
||||||
test: t,
|
test: t,
|
||||||
fetchJourneys: client.journeys,
|
fetchJourneys: client.journeys,
|
||||||
|
|
|
@ -46,7 +46,7 @@ const westhafen = '900000001201'
|
||||||
const wedding = '900000009104'
|
const wedding = '900000009104'
|
||||||
const württembergallee = '900000026153'
|
const württembergallee = '900000026153'
|
||||||
|
|
||||||
tap.test('journeys – Spichernstr. to Bismarckstr.', async (t) => {
|
tap.test('journeys – Spichernstr. to Bismarckstr.', async (t) => {
|
||||||
const res = await client.journeys({
|
const res = await client.journeys({
|
||||||
type: 'stop',
|
type: 'stop',
|
||||||
id: spichernstr,
|
id: spichernstr,
|
||||||
|
@ -69,7 +69,7 @@ tap.test('journeys – Spichernstr. to Bismarckstr.', async (t) => {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('journeys – only subway', async (t) => {
|
tap.test('journeys – only subway', async (t) => {
|
||||||
const res = await client.journeys(spichernstr, bismarckstr, {
|
const res = await client.journeys(spichernstr, bismarckstr, {
|
||||||
results: 20,
|
results: 20,
|
||||||
departure: when,
|
departure: when,
|
||||||
|
@ -104,9 +104,9 @@ tap.test('journeys – only subway', async (t) => {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
// todo: journeys – with arrival time
|
// todo: journeys – with arrival time
|
||||||
|
|
||||||
tap.test('journeys – fails with no product', (t) => {
|
tap.test('journeys – fails with no product', (t) => {
|
||||||
journeysFailsWithNoProduct({
|
journeysFailsWithNoProduct({
|
||||||
test: t,
|
test: t,
|
||||||
fetchJourneys: client.journeys,
|
fetchJourneys: client.journeys,
|
||||||
|
@ -213,7 +213,7 @@ tap.skip('trips', async (t) => {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('journeys – station to address', async (t) => {
|
tap.test('journeys – station to address', async (t) => {
|
||||||
const torfstr = {
|
const torfstr = {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
address: '13353 Berlin-Wedding, Torfstr. 17',
|
address: '13353 Berlin-Wedding, Torfstr. 17',
|
||||||
|
@ -235,7 +235,7 @@ tap.test('journeys – station to address', async (t) => {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('journeys – station to POI', async (t) => {
|
tap.test('journeys – station to POI', async (t) => {
|
||||||
const atze = {
|
const atze = {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
id: '900980720',
|
id: '900980720',
|
||||||
|
|
Loading…
Add table
Reference in a new issue