Skip to content

Commit

Permalink
test: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 19, 2023
1 parent 3a1031e commit 9a0e022
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ const { MODEL_S, MODEL_X, MODEL_Y, MODEL_3 } = require('tesla-title')

const teslaSpec = require('../')

const cars = [].concat(
Object.keys(MODEL_S),
Object.keys(MODEL_X),
Object.keys(MODEL_Y),
Object.keys(MODEL_3)
)
const cars = [
['Model S', MODEL_S],
['Model 3', MODEL_3],
['Model X', MODEL_X],
['Model Y', MODEL_Y]
].reduce((acc, [baseTitle, data]) => {
const titles = Array.from(new Map(data).keys()).map(model => `${baseTitle} ${model}`.trim())
acc = acc.concat(titles)
return acc
}, [])

const omit = ['Model S Plaid+']

Expand Down

0 comments on commit 9a0e022

Please sign in to comment.