Skip to content

Latest commit

 

History

History
1083 lines (647 loc) · 60.5 KB

CHANGELOG.md

File metadata and controls

1083 lines (647 loc) · 60.5 KB

@effect/vitest

0.17.1

Patch Changes

0.17.0

Minor Changes

  • #4254 bcc600b Thanks @tim-smart! - prevent use of .live with .layer api

Patch Changes

0.16.3

Patch Changes

0.16.2

Patch Changes

0.16.1

Patch Changes

0.16.0

Patch Changes

0.15.0

Minor Changes

  • #4173 62f12d8 Thanks @thewilkybarkid! - Support native arbitraries in @effect/vitest

Patch Changes

0.14.9

Patch Changes

0.14.8

Patch Changes

0.14.7

Patch Changes

0.14.6

Patch Changes

0.14.5

Patch Changes

0.14.4

Patch Changes

0.14.3

Patch Changes

0.14.2

Patch Changes

0.14.1

Patch Changes

0.14.0

Patch Changes

0.13.20

Patch Changes

0.13.19

Patch Changes

0.13.18

Patch Changes

0.13.17

Patch Changes

0.13.16

Patch Changes

0.13.15

Patch Changes

0.13.14

Patch Changes

0.13.13

Patch Changes

0.13.12

Patch Changes

0.13.11

Patch Changes

0.13.10

Patch Changes

0.13.9

Patch Changes

0.13.8

Patch Changes

0.13.7

Patch Changes

0.13.6

Patch Changes

0.13.5

Patch Changes

0.13.4

Patch Changes

0.13.3

Patch Changes

0.13.2

Patch Changes

0.13.1

Patch Changes

0.13.0

Patch Changes

  • #3764 685a460 Thanks @jessekelly881! - Adds property testing to @effect/vitest

    import { Schema } from "effect"
    import { it } from "@effect/vitest"
    
    const realNumber = Schema.Finite.pipe(Schema.nonNaN())
    
    it.prop("symmetry", [realNumber, realNumber], ([a, b]) => a + b === b + a)
    
    it.effect.prop("symmetry", [realNumber, realNumber], ([a, b]) =>
      Effect.gen(function* () {
        yield* Effect.void
        return a + b === b + a
      })
    )
    
    it.scoped.prop(
      "should detect the substring",
      { a: Schema.String, b: Schema.String, c: Schema.String },
      ({ a, b, c }) =>
        Effect.gen(function* () {
          yield* Effect.scope
          return (a + b + c).includes(b)
        })
    )
  • Updated dependencies [4a01828, 4a01828, c79c4c1, 38d30f0, 5821ce3]:

0.12.1

Patch Changes

0.12.0

Minor Changes

  • #3744 9fef880 Thanks @tim-smart! - expose hook timeout option to vitest layer api

0.11.1

Patch Changes

0.11.0

Patch Changes

0.10.6

Patch Changes

0.10.5

Patch Changes

  • #3689 4d91f41 Thanks @tim-smart! - add layer api to @effect/vitest

    This allows you to share a Layer between multiple tests, optionally wrapping the tests in a describe block.

    import { expect, layer } from "@effect/vitest"
    import { Context, Effect, Layer } from "effect"
    
    class Foo extends Context.Tag("Foo")<Foo, "foo">() {
      static Live = Layer.succeed(Foo, "foo")
    }
    
    class Bar extends Context.Tag("Bar")<Bar, "bar">() {
      static Live = Layer.effect(
        Bar,
        Effect.map(Foo, () => "bar" as const)
      )
    }
    
    layer(Foo.Live)("layer", (it) => {
      it.effect("adds context", () =>
        Effect.gen(function* () {
          const foo = yield* Foo
          expect(foo).toEqual("foo")
        })
      )
    
      it.layer(Bar.Live)("nested", (it) => {
        it.effect("adds context", () =>
          Effect.gen(function* () {
            const foo = yield* Foo
            const bar = yield* Bar
            expect(foo).toEqual("foo")
            expect(bar).toEqual("bar")
          })
        )
      })
    })

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

0.10.1

Patch Changes

0.10.0

Patch Changes

0.9.3

Patch Changes

0.9.2

Patch Changes

0.9.1

Patch Changes

0.9.0

Patch Changes

0.8.9

Patch Changes

0.8.8

Patch Changes

0.8.7

Patch Changes

0.8.6

Patch Changes

0.8.5

Patch Changes

0.8.4

Patch Changes

0.8.3

Patch Changes

0.8.2

Patch Changes

  • #3416 8cc1517 Thanks @sukovanej! - Interrupt an effect when a test finishes. This ensures allocated resources will be correctly released even if the test times out.

    import { it } from "@effect/vitest"
    import { Console, Effect, Layer } from "effect"
    
    class Database extends Effect.Tag("Database")<Database, {}>() {
      static readonly test = Layer.scoped(
        Database,
        Effect.acquireRelease(
          Effect.as(Console.log("database setup"), Database.of({})),
          () => Console.log("database teardown")
        )
      )
    }
    
    it.live(
      "testing with closable resources",
      () =>
        Effect.gen(function* () {
          const database = yield* Database
          // performing some time consuming operations
          yield* Effect.sleep("500 millis")
        }).pipe(Effect.provide(Database.test)),
      { timeout: 100 }
    )

0.8.1

Patch Changes

0.8.0

Patch Changes

0.7.0

Minor Changes

Patch Changes

0.6.12

Patch Changes

0.6.11

Patch Changes

0.6.10

Patch Changes

0.6.9

Patch Changes

0.6.8

Patch Changes

0.6.7

Patch Changes

0.6.6

Patch Changes

0.6.5

Patch Changes

0.6.4

Patch Changes

0.6.3

Patch Changes

0.6.2

Patch Changes

0.6.1

Patch Changes

0.6.0

Minor Changes

  • #3122 489d20a Thanks @sukovanej! - Refactor @effect/vitest package.

    • Clear separation of the public API and internals.
    • Fix type of scoped, live, scopedLive and effect objects. Make sure skip and only are available.
    • Add each method to scoped, live, scopedLive and effect objects.

    Example usage

    import { expect, it } from "@effect/vitest"
    import { Effect } from "effect"
    
    it.scoped.skip("test skipped", () =>
      Effect.acquireRelease(Effect.die("skipped anyway"), () => Effect.void)
    )
    
    it.effect.each([1, 2, 3])("effect each %s", (n) =>
      Effect.sync(() => expect(n).toEqual(n))
    )

Patch Changes

0.5.21

Patch Changes

0.5.20

Patch Changes

0.5.19

Patch Changes

0.5.18

Patch Changes

0.5.17

Patch Changes

0.5.16

Patch Changes

0.5.15

Patch Changes

0.5.14

Patch Changes

0.5.13

Patch Changes

0.5.12

Patch Changes

0.5.11

Patch Changes

0.5.10

Patch Changes

0.5.9

Patch Changes

0.5.8

Patch Changes

0.5.7

Patch Changes

0.5.6

Patch Changes

0.5.5

Patch Changes

0.5.4

Patch Changes

0.5.3

Patch Changes

0.5.2

Patch Changes

0.5.1

Patch Changes

0.5.0

Minor Changes

Patch Changes

0.4.5

Patch Changes

0.4.4

Patch Changes

0.4.3

Patch Changes

0.4.2

Patch Changes

0.4.1

Patch Changes

0.4.0

Minor Changes

Patch Changes

0.3.9

Patch Changes

0.3.8

Patch Changes

0.3.7

Patch Changes

0.3.6

Patch Changes

0.3.5

Patch Changes

0.3.4

Patch Changes

0.3.3

Patch Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

Patch Changes

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

  • #2394 b6ee13b Thanks @mikearnaldi! - Fix helper signatures removing support for passing effects as discriminating between effects and functions is not safe

    Re-export vitest with patched "it"

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

Patch Changes