Skip to content

JS Testing Feature: Multiple return values from interaction #30

@srinjoyc

Description

@srinjoyc

👋   If you are interested in working on this issue, please check out the Getting Started guide on HackerEarth!

Description (Problem Statement)

The JS Testing Framework has two functions: sendTransaction and executeScript that currently return a single result from their execution. It does not have a good way of handling errors that should be caught and processed. This can cause issues with multiple interactions called in succession.

Experience Required

  • Great proficiency with JavaScript
  • Good understanding of Cadence and Flow JS SDK

Minimum Feature Set (Acceptance Criteria)

  • Catch error inside interaction code and always return tuple [result, error].

  • This should make it easier to assert the result of interaction using jest and other libraries.

  • Flow Cadut interactions are already implemented in such a way (refer to this piece of code as an example - https://github.com/onflow/flow-cadut/blob/main/src/interactions.js#L55-L63) so it's mostly a refactoring task.

Extension Feature Set (Optional)

Parse error message and provide an error in form of an object, containing at least errorCode, message. If possible extract more information and format it in a human-readable and usable way.

Milestone Requirements

  1. Meet the minimum feature set and optionally the extension.

Software Requirements

Maintainability

Code should be written with best practices in mind.

Other Requirements

Documentation

  • Documentation should be updated according to the changes made.

Code standards or guidelines

Judging Criteria

Resources

Metadata

Metadata

Assignees

Labels

Local Development ToolsTier 3Small task, spanning 1 milestone, generally can be completed with limited domain knowledge.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions