tests: enable linter, fix code style

This commit is contained in:
Jannis R 2022-04-28 22:11:34 +02:00
parent 3c7d8f79b2
commit dda36c2da0
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
5 changed files with 25 additions and 16 deletions

View file

@ -9,7 +9,7 @@
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"ignorePatterns": ["node_modules", "test", "*example.js"],
"ignorePatterns": ["node_modules", "*example.js"],
"parserOptions": {
"ecmaVersion": 2018
},
@ -22,5 +22,15 @@
"ignoreRestSiblings": false
}
]
}
}
},
"overrides": [
{
"files": [
"test/**"
],
"rules": {
"no-unused-vars": "off"
}
}
]
}

View file

@ -14,7 +14,6 @@ const opt = {
results: 256,
duration: 30,
frames: 3,
products: null,
polylines: true,
when: '2019-08-19T21:00:00+02:00',
products: {}

View file

@ -32,7 +32,7 @@ const assertValidWhen = (actual, expected, name) => {
throw new AssertionError({
message: name + ' is out of range',
actual: ts,
expected: `${expected - delta} - ${+expected + delta}`,
expected: `${expected - delta} - ${+expected + delta}`,
operator: 'isRoughlyEqual',
})
}

View file

@ -63,7 +63,7 @@ const wienRenngasse = '1390186'
const wienKarlsplatz = '1390461'
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, {
results: 4,
departure: when,
@ -88,7 +88,7 @@ tap.test('journeys  Salzburg Hbf to Wien Westbahnhof', async (t) => {
// todo: journeys, only one product
tap.test('journeys  fails with no product', (t) => {
tap.test('journeys fails with no product', (t) => {
journeysFailsWithNoProduct({
test: t,
fetchJourneys: client.journeys,
@ -103,9 +103,9 @@ tap.test('journeys  fails with no product', (t) => {
tap.test('Salzburg Hbf to 1220 Wien, Fischerstrand 7', async (t) => {
const wagramerStr = {
type: 'location',
address: '1220 Wien, Fischerstrand 7',
latitude: 48.236216,
longitude: 16.425863
address: '1220 Wien, Fischerstrand 7',
latitude: 48.236216,
longitude: 16.425863
}
const res = await client.journeys(salzburgHbf, wagramerStr, {
results: 3,

View file

@ -46,7 +46,7 @@ const westhafen = '900000001201'
const wedding = '900000009104'
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({
type: 'stop',
id: spichernstr,
@ -69,7 +69,7 @@ tap.test('journeys  Spichernstr. to Bismarckstr.', async (t) => {
t.end()
})
tap.test('journeys  only subway', async (t) => {
tap.test('journeys only subway', async (t) => {
const res = await client.journeys(spichernstr, bismarckstr, {
results: 20,
departure: when,
@ -104,9 +104,9 @@ tap.test('journeys  only subway', async (t) => {
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({
test: t,
fetchJourneys: client.journeys,
@ -213,7 +213,7 @@ tap.skip('trips', async (t) => {
t.end()
})
tap.test('journeys  station to address', async (t) => {
tap.test('journeys station to address', async (t) => {
const torfstr = {
type: 'location',
address: '13353 Berlin-Wedding, Torfstr. 17',
@ -235,7 +235,7 @@ tap.test('journeys  station to address', async (t) => {
t.end()
})
tap.test('journeys  station to POI', async (t) => {
tap.test('journeys station to POI', async (t) => {
const atze = {
type: 'location',
id: '900980720',