Skip to content

Adopt BTT and shared base contract across test suite #248

@lumoswiz

Description

@lumoswiz

Testing Issue

  • Test files repeat a lot of setup logic.
  • There is no standardized base test contract or shared utilities, so patterns and helpers may differ across files.
  • Tests don’t consistently follow a structured framework (e.g. BTT), leaving contributors without a clear testing specification or naming convention.
  • It’s hard to see, at a glance, what behaviours and edge cases are intended to be covered by a suite.

Description

  • Introduce a shared base test contract + utilities for common setup and assertions
  • Refactor existing tests to inherit from this base and remove duplicated logic
  • Adopt BTT-style (given / when / then) naming and structure across the test suite
  • Handle the refactor through multiple focused PRs

Proposed Plan / Checklist

  • Introduce shared base test contract + utilities

    • Common setup (fixtures, actors, deployment helpers, etc.)
    • Shared assertion / revert helpers and utilities
  • For each test suite:

    • Refactor to use the shared base test contract
    • Refactor tests to BTT-style (given / when / then) naming and structure
    • Generate a .tree spec

Implementation note:

  • First PR: introduce shared base test contract + utilities.
  • Follow-up PRs: one PR per test suite (or small group of suites) to adopt the base contract and implement BTT.

Target File/Function(s) being tested

  • Entire test suite (all contracts under test/)

Recommended VSCode Extensions (optional)

These are not required, but useful:

  • Tree – syntax highlighting for .tree files
  • ASCII Tree Generator – convenient way to generate ASCII trees for specs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions