@@ -13,7 +13,6 @@ import {
1313 artifactTestZeroHandling ,
1414} from './fixture/debugging/debugging_contracts.js' ;
1515import { sha256 } from '@cashscript/utils' ;
16- import { vi } from 'vitest' ;
1716
1817describe ( 'Debugging tests' , ( ) => {
1918 describe ( 'console.log statements' , ( ) => {
@@ -659,23 +658,21 @@ describe('Debugging tests', () => {
659658 VmTarget . BCH_SPEC ,
660659 ] as const ;
661660
662- for ( const vmTarget of vmTargets ) {
663- it ( `should execute and log correctly with vmTarget ${ vmTarget } ` , async ( ) => {
664- const provider = new MockNetworkProvider ( { vmTarget } ) ;
665- const contractTestLogs = new Contract ( artifactTestLogs , [ alicePub ] , { provider } ) ;
666- const contractUtxo = randomUtxo ( ) ;
667- provider . addUtxo ( contractTestLogs . address , contractUtxo ) ;
661+ it . each ( vmTargets ) ( 'should execute and log correctly with vmTarget %s' , async ( vmTarget ) => {
662+ const provider = new MockNetworkProvider ( { vmTarget } ) ;
663+ const contractTestLogs = new Contract ( artifactTestLogs , [ alicePub ] , { provider } ) ;
664+ const contractUtxo = randomUtxo ( ) ;
665+ provider . addUtxo ( contractTestLogs . address , contractUtxo ) ;
668666
669- const transaction = new TransactionBuilder ( { provider } )
670- . addInput ( contractUtxo , contractTestLogs . unlock . transfer ( new SignatureTemplate ( alicePriv ) , 1000n ) )
671- . addOutput ( { to : contractTestLogs . address , amount : 10000n } ) ;
667+ const transaction = new TransactionBuilder ( { provider } )
668+ . addInput ( contractUtxo , contractTestLogs . unlock . transfer ( new SignatureTemplate ( alicePriv ) , 1000n ) )
669+ . addOutput ( { to : contractTestLogs . address , amount : 10000n } ) ;
672670
673- expect ( transaction . getLibauthTemplate ( ) . supported [ 0 ] ) . toBe ( vmTarget ?? 'BCH_2025_05' ) ;
671+ expect ( transaction . getLibauthTemplate ( ) . supported [ 0 ] ) . toBe ( vmTarget ?? 'BCH_2025_05' ) ;
674672
675- const expectedLog = new RegExp ( `^\\[Input #0] Test.cash:10 0x[0-9a-f]{130} 0x${ binToHex ( alicePub ) } 1000 0xbeef 1 test true$` ) ;
676- expect ( transaction ) . toLog ( expectedLog ) ;
677- } ) ;
678- }
673+ const expectedLog = new RegExp ( `^\\[Input #0] Test.cash:10 0x[0-9a-f]{130} 0x${ binToHex ( alicePub ) } 1000 0xbeef 1 test true$` ) ;
674+ expect ( transaction ) . toLog ( expectedLog ) ;
675+ } ) ;
679676 } ) ;
680677} ) ;
681678
0 commit comments