livepeer / livepeer/protocol

Abstract shared behavior from tests

Open
#568 0 comments 0 reactions 1 assignee View on GitHub

@kautukkundan is already working on this.

Since May 26, 2022.

Dominant language
JavaScript
Stars
155
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Context
The current unit/integration tests of the protocol are very extensive and meticulous, however their main 'side-effect' is that they repeat the same assertions to test different scenarios both across the same test suite and different files (i.e.: here and here).
This would make the tests quite difficult to refactor should there be any changes in the business logic of the protocol in the future, and it also makes their code readability quite daunting.
Also some chai matchers are imported on a file-basis rather than being defined globally.

Proposal
Define the shared behavior of the tests and abstract it away in separate classes by using Mocha contexts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.