mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-26 05:31:47 +00:00
update fluence, add fold-join test, use built-in from lib
This commit is contained in:
@ -14,6 +14,7 @@ import {complexCall} from "./examples/complex";
|
||||
import {constantsCall} from "./examples/constantsCall";
|
||||
import {streamCall} from "./examples/streamCall";
|
||||
import {topologyCall} from "./examples/topologyCall";
|
||||
import {foldJoinCall} from "./examples/foldJoinCall";
|
||||
let deepEqual = require('deep-equal')
|
||||
|
||||
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
|
||||
@ -25,6 +26,14 @@ function checkCall(name: string, expected: any, actual: any, callBackOnError: ()
|
||||
}
|
||||
}
|
||||
|
||||
function checkCallBy(name: string, actual: any, by: (res: any) => boolean, callBackOnError: () => void) {
|
||||
if (!by(actual)) {
|
||||
console.error(`${name} call has the wrong result`)
|
||||
console.error("actual: " + actual)
|
||||
callBackOnError()
|
||||
}
|
||||
}
|
||||
|
||||
const main = async () => {
|
||||
const client = await createClient(testNet[0]);
|
||||
const client2 = await createClient(testNet[1]);
|
||||
@ -77,6 +86,9 @@ const main = async () => {
|
||||
// topology.aqua
|
||||
let topologyResult = await topologyCall(client, client2)
|
||||
|
||||
// foldJoin.aqua
|
||||
let foldJoinResult = await foldJoinCall(client)
|
||||
|
||||
await client.disconnect();
|
||||
|
||||
let success = true;
|
||||
@ -106,6 +118,8 @@ const main = async () => {
|
||||
|
||||
checkCall("topologyCall", topologyResult, "finish", cb)
|
||||
|
||||
checkCallBy("foldJoinCall", foldJoinResult, (res) => res.length == 3, cb)
|
||||
|
||||
if (success) {
|
||||
process.exit(0)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user