- Updated dependencies [
a8b0ddb
,507d546
,a8b0ddb
,8db239b
,84a0911
,84a0911
,3179a9f
,6cb9b76
,1fcbe55
,d9a63d9
]:
-
#3973
d05d663
Thanks @lishaduck! - Add it.*.fails method to @effect/vitest -
#4227
b514200
Thanks @sukovanej! - Fixit.prop
type signature.
-
#4068
3d2b7a7
Thanks @mikearnaldi! - Allow passing fast-check parameters to prop functionit.effect.prop( "adds context", [realNumber], ([num]) => Effect.gen(function* () { const foo = yield* Foo expect(foo).toEqual("foo") return num === num }), { fastCheck: { numRuns: 200 } } )
-
Updated dependencies [
abb22a4
,f369a89
,642376c
,3d2b7a7
,73f9c6f
,17cb451
,d801820
,e1eeb2d
,c11f3a6
,618f7e0
,c0ba834
,e1eeb2d
]:
- Updated dependencies [
1a6b52d
]:
- Updated dependencies [
9f5a6f7
,22905cf
,9f5a6f7
,1e59e4f
,8d914e5
,03bb00f
,9f5a6f7
,14e1149
,9f5a6f7
,9f5a6f7
]:
- Updated dependencies [
01cee56
]:
- Updated dependencies [
147434b
,6e69493
,147434b
,5eff3f6
,d9fe79b
,251d189
,5a259f3
,b4ce4ea
,15fcc5a
,9bc9a47
,aadb8a4
,1e2747c
,9264162
,e0b9b09
,c36f3b9
,aadb8a4
]:
- Updated dependencies [
af409cf
]:
- Updated dependencies [
42c4ce6
]:
- Updated dependencies [
995bbdf
]:
- Updated dependencies [
dd14efe
]:
- Updated dependencies [
5eef499
]:
- Updated dependencies [
ce1c21f
]:
- Updated dependencies [
2367708
]:
- Updated dependencies [
b9423d8
]:
- Updated dependencies [
9604d6b
]:
-
#3764
685a460
Thanks @jessekelly881! - Adds property testing to @effect/vitestimport { 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
]:
- Updated dependencies [
61a99b2
]:
- Updated dependencies [
3b2ad1d
]:
- Updated dependencies [
ff3d1aa
,0ba66f2
,bf77f51
,016f9ad
,0779681
,534129f
,d75140c
,be0451c
,9237ac6
,be0451c
,5b36494
,c716adb
,4986391
,d75140c
,d1387ae
]:
-
#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 adescribe
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") }) ) }) })
- Updated dependencies [
4509656
]:
- Updated dependencies [
bb5ec6b
]:
- Updated dependencies [
f0d8ef1
]:
- Updated dependencies [
fcfa6ee
,bb9931b
,5798f76
,5f0bfa1
,812a4e8
,273565e
,569a801
,aa1fa53
,02f6b06
,12b893e
,bbad27e
,adf7d7a
,007289a
,42a8f99
,eebfd29
,040703d
]:
- Updated dependencies [
35a0f81
]:
- Updated dependencies [
db89601
,2f456cc
,8745e41
,e557838
,d6e7e40
,8356321
,192f2eb
,718cb70
,e9d0310
,6bf28f7
]:
- Updated dependencies [
e809286
]:
- Updated dependencies [
50ec889
]:
- Updated dependencies [
04adcac
]:
- Updated dependencies [
fd4b2f6
]:
-
#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 } )
- Updated dependencies [
1e0fe80
,8135294
,cd255a4
,3845646
,2d09078
,4bce5a0
,4ddbff0
,e74cc38
,bb069b4
,cd255a4
,7d02174
]:
- Updated dependencies [
a9d7800
]:
- Updated dependencies [
55fdd76
]:
- Updated dependencies [
a1f5b83
,a1f5b83
,a1f5b83
,60bc3d0
,5ab348f
,60bc3d0
,3e04bf8
,e7fc45f
,a1f5b83
,4626de5
,f01e7db
,60bc3d0
,79d2d91
,ac71f37
,8432360
,e4bf1bf
,13cb861
,79d2d91
,e7fc45f
,9f66825
]:
- Updated dependencies [
a5737d6
]:
-
#3122
489d20a
Thanks @sukovanej! - Refactor@effect/vitest
package.- Clear separation of the public API and internals.
- Fix type of
scoped
,live
,scopedLive
andeffect
objects. Make sureskip
andonly
are available. - Add
each
method toscoped
,live
,scopedLive
andeffect
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)) )
- Updated dependencies [
a047af9
]:
- Updated dependencies [
3da1497
]:
- Updated dependencies [
66a1910
]:
- Updated dependencies [
c0ce180
,61707b6
,9c1b5b3
,a35faf8
,ff73c0c
,984d516
,8c3b8a2
,017e2f9
,91bf8a2
,c6a4a26
]:
- Updated dependencies [
6c89408
]:
- Updated dependencies [
a67b8fe
]:
- Updated dependencies [
fb91f17
]:
- Updated dependencies [
6801fca
]:
-
#2869
7348505
Thanks @gcanti! - Updatetimeout
parameter type inflakyTest
function to acceptDurationInput
-
Updated dependencies [
cc8ac50
]:
- Updated dependencies [
45578e8
]:
- Updated dependencies [
c1e991d
]:
- #2778
64c9414
Thanks @tim-smart! - Improve causal rendering in vitest by rethrowing pretty errors
-
#2778
64c9414
Thanks @tim-smart! - Throw plain error object derived from fiber failure -
Updated dependencies [
146cadd
,7135748
,7135748
,963b4e7
,64c9414
,7135748
,2cbb76b
,870c5fa
,7135748
,64c9414
]:
- Updated dependencies [
6ac4847
]:
-
#2732
e41e911
Thanks @mikearnaldi! - Fix usage oftoMatchObject
. -
Updated dependencies [
e41e911
]:
- Updated dependencies [
1f6dc96
]:
- Updated dependencies [
2e1cdf6
]:
- #2670
e5e56d1
Thanks @tim-smart! - IntroduceaddEqualityTesters
function which adds a custom vitest tester
- Updated dependencies [
e5e56d1
]:
-
#2656
557707b
Thanks @tim-smart! - update dependencies
- Updated dependencies [
18de56b
]:
- Updated dependencies [
9a24667
]:
- Updated dependencies [
a7b4b84
]:
-
Updated dependencies [
2cecdbd
]:
-
#2207
5a2314b
Thanks @github-actions! - replace use ofunit
terminology withvoid
For all the data types.
Effect.unit // => Effect.void Stream.unit // => Stream.void // etc
-
#2207
2fb7d9c
Thanks @github-actions! - Release Effect 3.0 🎉
- Updated dependencies [
1b5f0c7
,d50a652
,9a3bd47
,be9d025
,78b767c
,1499974
,1b5f0c7
,5c2b561
,a18f594
,1499974
,2f96d93
,5a2314b
,271b79f
,1b5f0c7
,2fb7d9c
,53d1c2a
,e7e1bbe
,10c169e
,6424181
]:
- Updated dependencies [
41c8102
,776ef2b
,217147e
,90776ec
,8709856
,232c353
,0ca835c
,8709856
,e983740
,e3e0924
]:
- Updated dependencies [
dadc690
]:
- Updated dependencies [
5170ce7
]:
- Updated dependencies [
6180c0c
]:
-
#2394
b6ee13b
Thanks @mikearnaldi! - Fix helper signatures removing support for passing effects as discriminating between effects and functions is not safeRe-export vitest with patched "it"
-
#2385
3307729
Thanks @tim-smart! - update typescript to 5.4 -
Updated dependencies [
3307729
]:
- #2369
64a250d
Thanks @tim-smart! - expose effect vitest helpers