11import test from 'ava'
22
33import { Substitute , SubstituteOf } from '../src'
4- import { SubstituteBase } from '../src/SubstituteBase'
54import { SubstituteNode } from '../src/SubstituteNode'
65
76interface Calculator {
@@ -12,7 +11,7 @@ interface Calculator {
1211}
1312
1413type InstanceReturningSubstitute < T > = SubstituteOf < T > & {
15- [ SubstituteBase . instance ] : Substitute
14+ [ SubstituteNode . instance ] : SubstituteNode
1615}
1716
1817test ( 'clears everything on a substitute' , t => {
@@ -21,8 +20,8 @@ test('clears everything on a substitute', t => {
2120 calculator . received ( ) . add ( 1 , 1 )
2221 calculator . clearSubstitute ( )
2322
24- t . is ( calculator [ Substitute . instance ] . recorder . records . size , 0 )
25- t . is ( calculator [ Substitute . instance ] . recorder . indexedRecords . size , 0 )
23+ t . is ( calculator [ SubstituteNode . instance ] . recorder . records . size , 0 )
24+ t . is ( calculator [ SubstituteNode . instance ] . recorder . indexedRecords . size , 0 )
2625
2726 t . throws ( ( ) => calculator . received ( ) . add ( 1 , 1 ) )
2827
@@ -31,8 +30,8 @@ test('clears everything on a substitute', t => {
3130 calculator . received ( ) . add ( 1 , 1 )
3231 calculator . clearSubstitute ( 'all' )
3332
34- t . is ( calculator [ Substitute . instance ] . recorder . records . size , 0 )
35- t . is ( calculator [ Substitute . instance ] . recorder . indexedRecords . size , 0 )
33+ t . is ( calculator [ SubstituteNode . instance ] . recorder . records . size , 0 )
34+ t . is ( calculator [ SubstituteNode . instance ] . recorder . indexedRecords . size , 0 )
3635
3736 t . throws ( ( ) => calculator . received ( ) . add ( 1 , 1 ) )
3837} )
@@ -43,8 +42,8 @@ test('clears received calls on a substitute', t => {
4342 calculator . add ( 1 , 1 ) . returns ( 2 )
4443 calculator . clearSubstitute ( 'receivedCalls' )
4544
46- t . is ( calculator [ Substitute . instance ] . recorder . records . size , 2 )
47- t . is ( calculator [ Substitute . instance ] . recorder . indexedRecords . size , 2 )
45+ t . is ( calculator [ SubstituteNode . instance ] . recorder . records . size , 2 )
46+ t . is ( calculator [ SubstituteNode . instance ] . recorder . indexedRecords . size , 2 )
4847
4948 t . throws ( ( ) => calculator . received ( ) . add ( 1 , 1 ) )
5049 t . is ( calculator . add ( 1 , 1 ) , 2 )
@@ -56,10 +55,10 @@ test('clears return values on a substitute', t => {
5655 calculator . add ( 1 , 1 ) . returns ( 2 )
5756 calculator . clearSubstitute ( 'substituteValues' )
5857
59- t . is ( calculator [ Substitute . instance ] . recorder . records . size , 2 )
60- t . is ( calculator [ Substitute . instance ] . recorder . indexedRecords . size , 2 )
58+ t . is ( calculator [ SubstituteNode . instance ] . recorder . records . size , 2 )
59+ t . is ( calculator [ SubstituteNode . instance ] . recorder . indexedRecords . size , 2 )
6160
6261 t . notThrows ( ( ) => calculator . received ( ) . add ( 1 , 1 ) )
6362 // @ts -expect-error
64- t . true ( calculator . add ( 1 , 1 ) [ SubstituteBase . instance ] instanceof SubstituteNode )
63+ t . true ( calculator . add ( 1 , 1 ) [ SubstituteNode . instance ] instanceof SubstituteNode )
6564} )
0 commit comments