1- import { Vector } from "./deps.ts" ;
2-
31/** The options for creating a test suite with the describe function. */
42export interface DescribeDefinition < T > extends Omit < Deno . TestDefinition , "fn" > {
53 fn ?: ( ) => void ;
@@ -56,12 +54,12 @@ const optionalTestStepDefinitionKeys: (keyof Deno.TestStepDefinition)[] = [
5654 */
5755export class TestSuite < T > {
5856 protected describe : DescribeDefinition < T > ;
59- protected steps : Vector < TestSuite < T > | ItDefinition < T > > ;
57+ protected steps : ( TestSuite < T > | ItDefinition < T > ) [ ] ;
6058 protected hasOnlyStep : boolean ;
6159
6260 constructor ( describe : DescribeDefinition < T > ) {
6361 this . describe = describe ;
64- this . steps = new Vector ( ) ;
62+ this . steps = [ ] ;
6563 this . hasOnlyStep = false ;
6664
6765 const suite : TestSuite < T > = describe . suite ??
@@ -130,14 +128,14 @@ export class TestSuite<T> {
130128
131129 /** The stack of tests that are actively running. */
132130 // deno-lint-ignore no-explicit-any
133- static active : Vector < TestSuite < any > > = new Vector ( ) ;
131+ static active : TestSuite < any > [ ] = [ ] ;
134132
135133 /** This is used internally for testing this module. */
136134 static reset ( ) : void {
137135 TestSuite . running = false ;
138136 TestSuite . started = false ;
139137 TestSuite . current = null ;
140- TestSuite . active = new Vector ( ) ;
138+ TestSuite . active = [ ] ;
141139 }
142140
143141 /** This is used internally to register tests. */
@@ -153,14 +151,14 @@ export class TestSuite<T> {
153151 static addingOnlyStep < T > ( suite : TestSuite < T > ) {
154152 if ( ! suite . hasOnlyStep ) {
155153 for ( let i = 0 ; i < suite . steps . length ; i ++ ) {
156- const step = suite . steps . get ( i ) ! ;
154+ const step = suite . steps [ i ] ! ;
157155 if ( step instanceof TestSuite ) {
158156 if ( ! ( step . hasOnlyStep || step . describe . only ) ) {
159- suite . steps . delete ( i -- ) ;
157+ suite . steps . splice ( i -- , 1 ) ;
160158 }
161159 } else {
162160 if ( ! step . only ) {
163- suite . steps . delete ( i -- ) ;
161+ suite . steps . splice ( i -- , 1 ) ;
164162 }
165163 }
166164 }
@@ -267,7 +265,7 @@ export class TestSuite<T> {
267265 context : T ,
268266 activeIndex = 0 ,
269267 ) {
270- const suite : TestSuite < T > | undefined = TestSuite . active . get ( activeIndex ) ;
268+ const suite : TestSuite < T > | undefined = TestSuite . active [ activeIndex ] ;
271269 if ( suite ) {
272270 context = { ...context } ;
273271 if ( suite . describe . beforeEach ) {
0 commit comments