try-otherwise test

This commit is contained in:
DieMyst
2021-06-11 17:49:57 +03:00
parent b8b96cc7c5
commit 7cc080df57
3 changed files with 32 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import {viaCall} from "./examples/viaCall";
import {nestedFuncsCall} from "./examples/nestedFuncsCall";
import {assignmentCall} from "./examples/assignment";
import {tryCatchCall} from "./examples/tryCatchCall";
import {tryOtherwiseCall} from "./examples/tryOtherwiseCall";
let deepEqual = require('deep-equal')
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
@ -109,6 +110,9 @@ const main = async () => {
// assignment.aqua
let assignmentResult = await assignmentCall(client)
// tryOtherwise.aqua
let tryOtherwiseResult = await tryOtherwiseCall(client)
// tryCatch.aqua
let tryCatchResult = await tryCatchCall(client)
@ -153,6 +157,8 @@ const main = async () => {
checkCall("assignmentCall", assignmentResult, ["abc", "hello"], cb)
checkCall("tryOtherwiseCall", tryOtherwiseResult, "error", cb)
checkCallBy("tryCatchCall", tryCatchResult, (res) => (res[0] as string).includes("Local service error: ret_code is 1024"), cb)
if (success) {