* Wrapping scripts with xor

* Add function subscribeForErrors to handle errors
This commit is contained in:
Pavel
2021-02-25 18:36:10 +03:00
committed by GitHub
parent 619c8a6d6a
commit c65c0afbee
8 changed files with 122 additions and 24 deletions

View File

@ -45,27 +45,39 @@ describe('== AIR suite', () => {
});
it('call broken script', async function () {
// arrange
const client = await createLocalClient();
const script = `(incorrect)`;
const script = `(htyth)`;
// act
const promise = client.sendScript(script);
await expect(client.sendScript(script)).rejects.toContain("aqua script can't be parsed");
// assert
await expect(promise).rejects.toContain("aqua script can't be parsed");
});
it('call script without ttl', async function () {
// arrange
const client = await createLocalClient();
const script = `(call %init_peer_id% ("" "") [""])`;
await expect(client.sendScript(script, undefined, 1)).rejects.toContain('Particle expired');
// act
const promise = client.sendScript(script, undefined, 1);
// assert
await expect(promise).rejects.toContain('Particle expired');
});
it.skip('call broken script by fetch', async function () {
// arrange
const client = await createLocalClient();
const script = `(incorrect)`;
const script = `(htyth)`;
// act
const promise = client.fetch(script, ['result']);
await expect(client.fetch(script, ['result'])).rejects.toContain("aqua script can't be parsed");
// assert
await expect(promise).rejects.toContain("aqua script can't be parsed");
});
it('check particle arguments', async function () {