Skip to content

Commit ed7c3c4

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

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

Sources/Common/DataModel/IncrementalPointLocator/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import vtkAbstractPointLocator, {
55
/**
66
* Initial values for vtkIncrementalPointLocator.
77
*/
8-
export interface IIncrementalPointLocatorInitialValues
9-
extends IAbstractPointLocatorInitialValues {}
8+
export interface IIncrementalPointLocatorInitialValues extends IAbstractPointLocatorInitialValues {}
109

1110
export interface vtkIncrementalPointLocator extends vtkAbstractPointLocator {}
1211

Sources/Common/DataModel/PointLocator/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import vtkPolyData from '../PolyData';
88
/**
99
*
1010
*/
11-
export interface IPointLocatorInitialValues
12-
extends IIncrementalPointLocatorInitialValues {
11+
export interface IPointLocatorInitialValues extends IIncrementalPointLocatorInitialValues {
1312
numberOfPointsPerBucket?: number;
1413
bucketSize?: number;
1514
}

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

Lines changed: 9 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,13 @@ 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(
284+
result2.intersect,
285+
'Should not intersect with line outside strip'
286+
).toBe(false);
287287
});
288288

289-
test('vtkTriangleStrip - clip', (t) => {
289+
it('vtkTriangleStrip - clip', () => {
290290
const triangleStrip = vtkTriangleStrip.newInstance();
291291
const points = vtkPoints.newInstance();
292292
points.setData(Float32Array.from([-1, 0, 0, 1, 0, 0, -1, 1, 0, 1, 1, 0]), 3);
@@ -320,14 +320,12 @@ test('vtkTriangleStrip - clip', (t) => {
320320
false
321321
);
322322

323-
t.equal(tris.getNumberOfCells(), 3, 'Should clip strip into 3 triangles');
324-
t.equal(
323+
expect(tris.getNumberOfCells(), 'Should clip strip into 3 triangles').toBe(3);
324+
expect(
325325
locatorPoints.getNumberOfPoints(),
326326
5,
327327
'Should create 5 unique kept points'
328-
);
329-
330-
t.end();
328+
).toBe(5);
331329
});
332330

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

0 commit comments

Comments
 (0)