mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-26 01:51:35 +00:00
co test, update version
This commit is contained in:
@ -21,6 +21,7 @@ import {nestedFuncsCall} from "./examples/nestedFuncsCall";
|
||||
import {assignmentCall} from "./examples/assignment";
|
||||
import {tryCatchCall} from "./examples/tryCatchCall";
|
||||
import {tryOtherwiseCall} from "./examples/tryOtherwiseCall";
|
||||
import {coCall} from "./examples/coCall";
|
||||
let deepEqual = require('deep-equal')
|
||||
|
||||
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
|
||||
@ -116,6 +117,9 @@ const main = async () => {
|
||||
// tryCatch.aqua
|
||||
let tryCatchResult = await tryCatchCall(client)
|
||||
|
||||
// coCall.aqua
|
||||
let coCallResult = await coCall(client)
|
||||
|
||||
console.log(tryCatchResult[0])
|
||||
|
||||
await client.disconnect();
|
||||
@ -159,6 +163,8 @@ const main = async () => {
|
||||
|
||||
checkCall("tryOtherwiseCall", tryOtherwiseResult, "error", cb)
|
||||
|
||||
checkCall("coCall", coCallResult, [ '/ip4/164.90.171.139/tcp/7770', '/ip4/164.90.171.139/tcp/9990/ws' ], cb)
|
||||
|
||||
checkCallBy("tryCatchCall", tryCatchResult, (res) => {
|
||||
return (res[0] as string).includes("Error: Service with id 'unex' not found") && res[1] === '/ip4/164.90.171.139/tcp/7770'
|
||||
}, cb)
|
||||
|
Reference in New Issue
Block a user