handle errors on local particle call (#25)

This commit is contained in:
Dima
2021-02-24 14:43:21 +03:00
committed by GitHub
parent c10cd1942a
commit 3eacf708e6
6 changed files with 65 additions and 9 deletions

View File

@ -44,6 +44,30 @@ describe('== AIR suite', () => {
expect(res).toEqual(arg);
});
it('call broken script', async function () {
const client = await createLocalClient();
const script = `(htyth)`;
await expect(client.sendScript(script)).rejects.toContain("aqua script can't be parsed");
});
it('call script without ttl', async function () {
const client = await createLocalClient();
const script = `(call %init_peer_id% ("" "") [""])`;
await expect(client.sendScript(script, undefined, 1)).rejects.toContain("Particle expired");
});
it.skip('call broken script by fetch', async function () {
const client = await createLocalClient();
const script = `(htyth)`;
await expect(client.fetch(script, ['result'])).rejects.toContain("aqua script can't be parsed");
});
it('check particle arguments', async function () {
// arrange
const serviceId = 'test_service';