Skip to content

Commit

Permalink
add test for incrementing
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 9, 2024
1 parent 44be0f9 commit 793c9d8
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@ import { _SERVICE as Actor } from './dfx_generated/cert-var/cert-var.did';

export function getTests(): Test {
return () => {
it('verifies certified variable increments', async () => {
const canisterName = 'cert-var';
const agent = await createAuthenticatedAgent(whoami());
const certVarCanister = await getCanisterActor<Actor>(
canisterName,
{
agent
}
);
await testCertifiedVariableUpdate(
0,
certVarCanister,
agent,
canisterName
);
for (let i = 1; i <= 5; i++) {
await certVarCanister.inc();
await testCertifiedVariableUpdate(
i,
certVarCanister,
agent,
canisterName
);
}
});

it('verifies certified variable updates', async () => {
const canisterName = 'cert-var';
const agent = await createAuthenticatedAgent(whoami());
Expand Down

0 comments on commit 793c9d8

Please sign in to comment.