Skip to content

Commit 68d34ac

Browse files
committed
docs(TriangleStrip): migrate testTriangleStrip to vitest
1 parent 11d0f37 commit 68d34ac

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Sources/Common/DataModel/TriangleStrip/test/testTriangleStrip.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import test from 'tape';
1+
import { it, expect } from 'vitest';
22
import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray';
33
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
44
import vtkCellArray from 'vtk.js/Sources/Common/Core/CellArray';
@@ -280,13 +280,12 @@ it('vtkTriangleStrip - intersectWithLine', () => {
280280
const p3 = [-2, 0, 0];
281281
const p4 = [-1, 0, 0];
282282
const result2 = triangleStrip.intersectWithLine(p3, p4, tol, x, pcoords);
283-
284-
tc.notOk(result2.intersect, 'Should not intersect with line outside strip');
285-
286-
tc.end();
283+
expect(result2.intersect, 'Should not intersect with line outside strip').toBe(
284+
false
285+
);
287286
});
288287

289-
test('vtkTriangleStrip - clip', (t) => {
288+
it('vtkTriangleStrip - clip', () => {
290289
const triangleStrip = vtkTriangleStrip.newInstance();
291290
const points = vtkPoints.newInstance();
292291
points.setData(Float32Array.from([-1, 0, 0, 1, 0, 0, -1, 1, 0, 1, 1, 0]), 3);
@@ -320,14 +319,12 @@ test('vtkTriangleStrip - clip', (t) => {
320319
false
321320
);
322321

323-
t.equal(tris.getNumberOfCells(), 3, 'Should clip strip into 3 triangles');
324-
t.equal(
322+
expect(tris.getNumberOfCells(), 'Should clip strip into 3 triangles').toBe(3);
323+
expect(
325324
locatorPoints.getNumberOfPoints(),
326325
5,
327326
'Should create 5 unique kept points'
328-
);
329-
330-
t.end();
327+
).toBe(5);
331328
});
332329

333330
it('vtkTriangleStrip - getParametricCenter', () => {

0 commit comments

Comments
 (0)