question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZIO Test: Add new spec type

See original GitHub issue

To provide a more “flat” style and without any commas, it would be nice to define a mutable spec, supporting the following syntax:

object MySpec extends MutableRunnableSpec {
  suite("foo") {
    testM("name") {
    } @@ ignore

    test("name 2") {
      suite("another suite") {
      }
    }
  }
}

This would be accomplished by defining suite and test and testM methods directly inside MutableRunnableSpec, which would mutably append to a data structure, which would be materialized when the def spec of the parent runnable spec is called.

In order to support annotations, the test and suite methods would have to return some object with @@ side-effect method, which modifies in-place the last definition by applying the test aspect.

The goal would be to preserve the existing ZIO Test syntax and feature set almost exactly, while at the same time getting away from the “comma” syntax which many find annoying.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
fokotcommented, Dec 23, 2020

I will take this

1reaction
hmemcpycommented, Jan 16, 2021

Also I think this issue can be closed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with ZIO Test - Medium
ZIO Test is a zero dependency Scala library for testing. It works very well using ZIO because ZIO Test provides the ability to...
Read more >
Spec | ZIO
Just like the ZIO data type, the Spec requires an environment of type R . When we write tests, we might need to...
Read more >
Effective testing with ZIO Test - Pavels Sisojevs
To start, we import zio.test package. It contains ZIO Test building blocks. We extend DefaultRunnableSpec trait which is similar to zio.App - it ......
Read more >
Working with shared dependencies in ZIO Test - In Absentia
In ZIO Test, it's common to refer to suites of tests as Specs, here we extend DefaultRunnableSpec which is responsible for several things....
Read more >
How to Test Effects in ZIO | An Introduction to ZIO Test
Each collection of tests is represented as a spec that can either be a test or a suite containing one or more other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found