Skip to content

Commit 39193ef

Browse files
committed
front: fix unresolved function references in IntervalsDataViz test
fail() is a jest-ism. We need to use assert.fail() with vitest. Fixes the following error when @types/jest is dropped: /home/simon/src/osrd/front/src/common/IntervalsDataViz/data.spec.ts 272:9 warning Unsafe call of a(n) `error` type typed value @typescript-eslint/no-unsafe-call 287:9 warning Unsafe call of a(n) `error` type typed value @typescript-eslint/no-unsafe-call 302:9 warning Unsafe call of a(n) `error` type typed value @typescript-eslint/no-unsafe-call Signed-off-by: Simon Ser <[email protected]>
1 parent 44c910e commit 39193ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

front/src/common/IntervalsDataViz/data.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import along from '@turf/along';
22
import distance from '@turf/distance';
33
import type { LineString, FeatureCollection } from 'geojson';
44
import { tail, last } from 'lodash';
5-
import { describe, it, expect } from 'vitest';
5+
import { describe, it, expect, assert } from 'vitest';
66

77
import { getLineStringDistance, update, resizeSegment, splitAt, mergeIn } from './data';
88
import type { LinearMetadataItem } from './types';
@@ -269,7 +269,7 @@ describe('Testing linear metadata functions', () => {
269269
];
270270
try {
271271
resizeSegment(wrapper, 3, -10);
272-
fail();
272+
assert.fail();
273273
} catch (e) {
274274
expect(e).toBeTruthy();
275275
}
@@ -284,7 +284,7 @@ describe('Testing linear metadata functions', () => {
284284
];
285285
try {
286286
resizeSegment(wrapper, 1, 10);
287-
fail();
287+
assert.fail();
288288
} catch (e) {
289289
expect(e).toBeTruthy();
290290
}
@@ -299,7 +299,7 @@ describe('Testing linear metadata functions', () => {
299299
];
300300
try {
301301
resizeSegment(wrapper, 4, -5);
302-
fail();
302+
assert.fail();
303303
} catch (e) {
304304
expect(e).toBeTruthy();
305305
}

0 commit comments

Comments
 (0)