npm / @effect/vitest
@effect/vitest
What changed in @effect/vitest 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-22.
3 breaking1 security74 new APIs and options4 behavior and defaults1 tooling4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@effect/vitest 487 changes
Breaking changes 3
Synchronous callbacks returning an Effect or Promise are rejected instead of silently passing; callbacks must return a boolean or void. Use it.effect.prop for Effect callbacks.
Property tests run with the native Arbitrary module instead of relying on fast-check.
Vitest 5 is required to use @effect/vitest.
Security 1
The decoder never reads external resources or expands entities declared in a DOCTYPE, preventing external entity and entity expansion attacks.
New APIs and options 74
Adds a reason for a closed client, transport, or legacy HTTP session.
Adds an event interface for comment text.
Adds an unstable combinator that joins byte chunks into one new Uint8Array.
Adds a reason for invalid client or toolkit options.
Adds an event interface for the XML declaration at the start of a document.
Adds a channel that parses UTF-8 bytes of one JSON document and emits the elements of one of its arrays.
Creates a channel that decodes UTF-8 XML bytes into events.
Adds options for JSON array decoding.
Adds an interface for options for the XML decoders.
Adds a channel that parses UTF-8 bytes of one JSON document and decodes array elements with a schema.
Adds a channel that parses JSON document text and decodes array elements with a schema.
Adds a channel that parses JSON document text and emits the elements of one of its arrays.
Creates a channel that decodes XML text chunks into events.
Adds an event interface for a document type declaration.
Adds the element tree interface, including attributes and children, collected by elements.
Creates a channel that collects the elements at a path into trees.
Adds an interface for options for elements.
Adds a channel that writes a stream of values as UTF-8 bytes of one JSON array.
Creates a channel that writes events as UTF-8 XML bytes.
Adds a channel that encodes values with a schema and writes them as UTF-8 bytes of one JSON array.
Adds a channel that encodes values with a schema and writes them as the text of one JSON array.
Adds a channel that writes a stream of values as the text of one JSON array.
Creates a channel that writes events as XML text.
Adds an event interface for an end tag.
Adds an unstable instance for comparing byte sequences for equality, byte by byte.
Adds the event type produced by decoders and consumed by encoders.
Creates a Streamable HTTP transport with request-owned JSON or SSE responses.
Adds a reason for non-success HTTP responses; JSON-RPC error bodies supply code, data, and description.
Adds a guard that checks whether a value is a JsonArrayError.
Returns whether a value is an MCP client.
Adds a guard that checks whether a value is an McpClientError.
Adds a guard that checks whether a value is an McpClientError reason.
Adds a check for whether a value is an XmlError.
Adds an error raised when JSON array encoding or decoding fails.
Provides a connected MCP client over Streamable HTTP using the HTTP client.
Provides a connected MCP client over stdio using the child process spawner.
Adds a reason for a message or discovery scan exceeding a client limit.
Constructs and connects a client using the supplied MCP transport service and its protocol adapter.
Adds an interface for a scoped connection to one MCP server.
Adds a service tag for applications that provide one default MCP connection.
Adds an error type that wraps MCP client or transport failure reasons.
Adds a union type for MCP client and transport failure reasons.
Adds a schema for the reasons carried by an McpClientError.
Adds an unstable instance that orders byte sequences lexicographically by unsigned byte value, placing a prefix before any longer sequence that starts with it.
Adds an event interface for a processing instruction.
Adds a reason for JSON-RPC errors or messages invalid for the selected protocol.
Adds a type for supported MCP wire protocol revisions.
Adds an event interface for a start tag, with attributes in document order.
Starts a scoped subprocess using newline-delimited JSON-RPC.
Adds an event interface for character data inside the root element.
Adds a reason for an operation that does not complete within its deadline.
Adds a reason for tool-reported execution errors and retains the complete result.
Discovers remote tools and binds their handlers using the standard Toolkit implementation.
Adds an interface for exchanging JSON-RPC messages with one MCP server using its protocol adapter.
Adds a service supplied by the built-in MCP transport constructors and layers.
Adds a reason for connection failures, including process or HTTP request start, write, read, or response-ending failures.
Adds a reason for unsupported operations or tool results that cannot be converted for a language model.
Adds a reason for request payloads, tool arguments, or results that fail schema validation.
Adds an error raised when XML cannot be decoded or encoded.
Creates a channel that decodes tar archive bytes into entries, streaming entry bodies from the archive input.
Creates a directory entry.
Creates a channel that encodes entries into tar archive bytes, streaming entry bodies back into archive bytes.
Defines a tar entry as a header and a stream of exactly header.size body bytes.
Provides options for the entry constructors.
Defines the kind of filesystem object described by a tar entry.
Creates a regular file entry from in-memory content.
Creates a regular file entry whose content is streamed from body.
Creates a hard link entry pointing at another entry of the archive.
Defines metadata of a tar entry.
Checks whether a value is a TarError.
Creates a symbolic link entry pointing at target.
Error raised when a tar archive cannot be encoded or decoded.
Adds a layer that detects terminal capabilities from Stdio and the current ConfigProvider.
Adds a service and interface for terminal rendering flags, including whether the current process can color, animate, or prompt.
Behavior and default changes 4
Returns tool-reported errors as results; supplying a schema turns them into a ToolError reason that retains the original result.
Every module and directly importable export now has an explicit stability tag: stable follows strict semver, while unstable may receive breaking changes in minor releases.
Unless a CliOutput.Formatter is provided, built-in help, version, and error output follows canColor.
The default reads NO_COLOR, FORCE_COLOR, TERM, and the current process TTY state; the layer reads the same variables through ConfigProvider and the TTY state of Stdio.
Tooling 1
Vitest fixtures are supported.
Fixes and other changes 4
Effects returned from beforeAll hooks are run with a Scope that closes when the suite finishes.
Effects returned from beforeEach hooks are run with a Scope that closes when the test finishes.
No longer throws a TypeError when no message is passed; shows the assertion diff instead.
No longer throws a TypeError when no message is passed; shows the assertion diff instead.