typelevel / typelevel/cats-effect-testing

Scalatest: Support use of fixture contexts

Open
#590 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
194
Forks
42
Avg merge
5h 16m
Merged PRs (30d)
1

Description

I can't imagine a way that this can work but thought I'd post a feature request to see if bigger brains than mine can come up with anything.

I wrote a great PoC with cats-effect-testing with a test like:

"foo" in IO { 
   "stuff"
}: IO[String]

The problem is in reality most of our tests use Fixture Contexts to mix in fixture data, so would look like:

"foo" in new TestFixture with OtherTestFixture { 
  IO {
   "stuff"
  } 
}: TestFixture with OtherTestFixture

The problem of course is : TestFixture with OtherTestFixture which means the test doesn't return an IO[_] which means the library can't evaluate it.

I can't think of a way to both keep the use of fixture contexts to minimise change, but also be able to have tests that must be effectful (i.e. Acceptance/E2E tests)

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.

Research direction

Start by reviewing the Scalatest integration and the fixture-context examples shown in the issue, then trace how the library identifies tests returning IO[_]. Determine whether fixture contexts can remain in use while the effectful test is still evaluated. Done means a documented, working approach for the shown TestFixture with OtherTestFixture pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.