add test for return literal

This commit is contained in:
DieMyst
2021-08-04 12:26:59 +03:00
parent 136d56138e
commit b702c4bf57
30 changed files with 41 additions and 27 deletions

View File

@ -26,6 +26,7 @@ import {passArgsCall} from "./examples/passArgsCall";
import {streamArgsCall} from "./examples/streamArgsCall";
import {streamResultsCall} from "./examples/streamResultsCall";
import {pushToStreamCall} from "./examples/pushToStreamCall";
import {literalCall} from "./examples/returnLiteralCall";
let deepEqual = require('deep-equal')
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
@ -138,6 +139,9 @@ const main = async () => {
// pushToStream.aqua
let pushToStreamResult = await pushToStreamCall(client)
// literalCall.aqua
let literalCallResult = await literalCall(client)
await client.disconnect();
let success = true;
@ -191,6 +195,8 @@ const main = async () => {
checkCall("pushToStreamCall", pushToStreamResult, ["hello", "get_string"], cb)
checkCall("literalCall", literalCallResult, "some literal", 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)