diff --git a/src/__test__/examples.spec.ts b/src/__test__/examples.spec.ts index 1396b33..dae2acd 100644 --- a/src/__test__/examples.spec.ts +++ b/src/__test__/examples.spec.ts @@ -34,12 +34,11 @@ import {streamCanCall} from "../examples/streamCan"; import {streamCallbackCall} from "../examples/streamCallback"; import {streamResCall} from "../examples/streamRestrictionsCall"; import {joinIdxCall, joinIdxLocalCall, joinIdxRelayCall} from "../examples/joinCall"; -import {topologyBug427} from "../compiled/examples/topology"; import {recursiveStreamsCall} from "../examples/recursiveStreamsCall"; import {allEmptySugarCall, arraySugarCall, optionSugarCall, streamSugarCall} from "../examples/collectionSugarCall"; import {funcsCall} from "../examples/funcsCall"; import {nestedDataCall} from "../examples/nestedDataCall"; -import {ifCalcCall, mathTest1Call, mathTest2Call} from "../examples/mathCall"; +import {mathTest1Call, mathTest2Call} from "../examples/mathCall"; var selfPeerId: string; var peer2: FluencePeer; @@ -241,12 +240,6 @@ describe('Testing examples', () => { expect(res).toEqual(3); }); - it('math.aqua if test', async () => { - let res = await ifCalcCall(); - - expect(res).toEqual(1); - }); - it('foldJoin.aqua', async () => { let foldJoinResult = await foldJoinCall(); expect(foldJoinResult.length).toBeGreaterThanOrEqual(3) @@ -254,7 +247,7 @@ describe('Testing examples', () => { it('funcs.aqua', async () => { let result = await funcsCall(); - expect(result).toEqual([13, 6, 3]); + expect(result).toEqual([13, 6, 3, 1]); }, 7000); it('option.aqua', async () => { diff --git a/src/__test__/run.spec.ts b/src/__test__/run.spec.ts index 8cd9ff8..a004481 100644 --- a/src/__test__/run.spec.ts +++ b/src/__test__/run.spec.ts @@ -7,6 +7,7 @@ const exec = util.promisify(require('child_process').exec); describe('Testing run command', () => { const addr = krasnodar[4].multiaddr + const addr2 = krasnodar[1].multiaddr const nodeId = krasnodar[5].peerId const message = "hello" const message2 = "aaa" @@ -48,9 +49,8 @@ describe('Testing run command', () => { console.error(`stderr: ${stderr}`); } else { try { - let arr = stdout.split("\n").slice(5) - console.log(arr) - const result = JSON.parse(arr.join("")); + let arr = stdout.split("\n").slice(3) + const result = JSON.parse(arr.join("\n")); expect(Array.isArray(result)).toBeTruthy(); } catch (e) { @@ -69,9 +69,8 @@ describe('Testing run command', () => { console.error(`stderr: ${stderr}`); } else { try { - let arr = stdout.split("\n").slice(5) - console.log(arr) - const result = JSON.parse(arr.join("")); + let arr = stdout.split("\n").slice(3) + const result = JSON.parse(arr.join("\n")); expect(Array.isArray(result)).toBeTruthy(); } catch (e) { @@ -82,16 +81,15 @@ describe('Testing run command', () => { }); }, 16000); - it('run listInterfaces', (done) => { + it.skip('run listInterfaces', (done) => { exec(listInterfacesCall, (error, stdout, stderr) => { if (error) { - console.error(`error: ${error.message}`); + console.error(`error: ${error}`); } else if (stderr) { console.error(`stderr: ${stderr}`); } else { try { - let arr = stdout.split("\n").slice(5) - console.log(arr) + let arr = stdout.split("\n").slice(3) const result = JSON.parse(arr.join("")); expect(Array.isArray(result)).toBeTruthy(); diff --git a/src/examples/funcsCall.ts b/src/examples/funcsCall.ts index 0df9fa6..3cff81d 100644 --- a/src/examples/funcsCall.ts +++ b/src/examples/funcsCall.ts @@ -1,4 +1,4 @@ -import {main, registerA, calc, calc2} from '../compiled/examples/funcs'; +import {main, registerA, calc, calc2, ifCalc} from '../compiled/examples/funcs'; export async function funcsCall() { @@ -20,5 +20,7 @@ export async function funcsCall() { console.log(c + ": " + arr) }) - return [res1, res2, res3] + let res4 = await ifCalc() + + return [res1, res2, res3, res4] } \ No newline at end of file diff --git a/src/examples/mathCall.ts b/src/examples/mathCall.ts index 6c7c4dd..57d3c68 100644 --- a/src/examples/mathCall.ts +++ b/src/examples/mathCall.ts @@ -1,5 +1,4 @@ import {test1, test2} from '../compiled/examples/math'; -import {ifCalc} from "../compiled/examples/funcs"; export async function mathTest1Call(): Promise { return await test1(); @@ -7,8 +6,4 @@ export async function mathTest1Call(): Promise { export async function mathTest2Call(): Promise { return await test2(); -} - -export async function ifCalcCall(): Promise { - return await ifCalc(); } \ No newline at end of file