Skip to content

Commit

Permalink
add expected Error on compensate test
Browse files Browse the repository at this point in the history
  • Loading branch information
j03-dev committed Jan 14, 2025
1 parent d0473bd commit a2e4bd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/typegate/src/runtimes/substantial/deno_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class Utils {
constructor(private ctx: Context) {}

async now() {
return await this.ctx.save(() => Date.now());
return await this.ctx.save(() => new Date());
}

async random(a: number, b: number) {
Expand Down
1 change: 1 addition & 0 deletions tests/runtimes/substantial/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export function basicTestTemplate(
}
`
.withVars({ account_balance })
.expectErrorContains("Transaction Failed")
.on(e);
});
},
Expand Down
2 changes: 1 addition & 1 deletion tests/runtimes/substantial/workflows/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export async function compensation(ctx: Context) {
debitAccount(2);
risky_transaction();
}, {
compensateWith: () => creditAccount(4),
compensateWith: () => creditAccount(2),
});

await ctx.save(() => debitAccount(100), {
Expand Down

0 comments on commit a2e4bd9

Please sign in to comment.