mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
test(roadtrip): read the last mock call without Array#at
The client's lib is ES2020, where Array#at does not exist. Local typecheck ran before the file was added and CI caught it.
This commit is contained in:
@@ -48,7 +48,8 @@ const routes = (days: RoadtripDay[]): RoadtripRoutes => ({
|
||||
|
||||
/** What the corridor hook was handed on the last render. */
|
||||
const lastCall = (): { line: LatLng[]; categories: string[]; widthKm: number } => {
|
||||
const call = useCorridorPois.mock.calls.at(-1)!
|
||||
const calls = useCorridorPois.mock.calls
|
||||
const call = calls[calls.length - 1]
|
||||
return { line: call[0], categories: call[1], widthKm: call[2] }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user