1- import test from 'tape ' ;
1+ import { it , expect } from 'vitest ' ;
22import vtkCellArray from 'vtk.js/Sources/Common/Core/CellArray' ;
33import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray' ;
44import vtkPoints from 'vtk.js/Sources/Common/Core/Points' ;
@@ -31,7 +31,7 @@ function createSquareAsTriangles() {
3131 return polydata ;
3232}
3333
34- test ( 'vtkClipPolyData clips a triangle mesh and produces clipped output' , ( t ) => {
34+ it ( 'vtkClipPolyData clips a triangle mesh and produces clipped output' , ( ) => {
3535 const plane = vtkPlane . newInstance ( {
3636 origin : [ 0 , 0 , 0 ] ,
3737 normal : [ 1 , 0 , 0 ] ,
@@ -48,25 +48,25 @@ test('vtkClipPolyData clips a triangle mesh and produces clipped output', (t) =>
4848 const kept = clipper . getOutputData ( ) ;
4949 const clipped = clipper . getOutputData ( 1 ) ;
5050
51- t . equal ( kept . getNumberOfPolys ( ) , 3 , 'kept side is triangulated into 3 polys' ) ;
52- t . equal (
51+ expect ( kept . getNumberOfPolys ( ) , 'kept side is triangulated into 3 polys' ) . toBe (
52+ 3
53+ ) ;
54+ expect (
5355 clipped . getNumberOfPolys ( ) ,
5456 3 ,
5557 'clipped side is triangulated into 3 polys'
56- ) ;
57- t . equal (
58+ ) . toBe ( 3 ) ;
59+ expect (
5860 kept . getNumberOfPoints ( ) ,
5961 7 ,
6062 'shared point set contains originals and intersections'
61- ) ;
62- t . equal ( clipped . getNumberOfPoints ( ) , 7 , 'clipped output shares point set' ) ;
63+ ) . toBe ( 7 ) ;
64+ expect ( clipped . getNumberOfPoints ( ) , 'clipped output shares point set' ) . toBe ( 7 ) ;
6365
6466 const keptScalars = kept . getPointData ( ) . getScalars ( ) . getData ( ) ;
65- t . equal ( keptScalars . length , 7 , 'generated clip scalars were attached' ) ;
66- t . ok (
67+ expect ( keptScalars . length , 'generated clip scalars were attached' ) . toBe ( 7 ) ;
68+ expect (
6769 Array . from ( keptScalars ) . includes ( 0 ) ,
6870 'intersection points carry the clip value'
69- ) ;
70-
71- t . end ( ) ;
71+ ) . toBeTruthy ( ) ;
7272} ) ;
0 commit comments