// `./clarigen-types` is generated by Clarigen automatically
import { project , accounts } from ' ./clarigen-types ' ;
import { projectFactory } from ' @clarigen/core ' ;
import { rov , txOk } from ' @clarigen/test ' ;
import { test , expect } from ' vitest ' ;
const alice = accounts . wallet_1 . address ;
const { counter } = projectFactory ( project , ' simnet ' );
test ( ' Counter contract test ' , async () => {
// Call read-only functions
const value = rov ( contracts . getCounter ());
expect ( value ). toEqual ( 1 n ); // `value`'s type is `bigint`
// Call public functions
const receipt = txOk ( counter . increment ( 2 ), alice );
expect ( receipt . value ). toEqual ( 3 n );
expect ( rov ( counter . getCounter ())). toEqual ( 3 n ); // new value
});
Copy