unstale

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

@unstale/cli 0.2.3 on npm

@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.

    4.0.6release notes

  • Property tests run with the native Arbitrary module instead of relying on fast-check.

    4.0.0release notes

  • Vitest 5 is required to use @effect/vitest.

    4.0.0release notes

Security 1

  • The decoder never reads external resources or expands entities declared in a DOCTYPE, preventing external entity and entity expansion attacks.

    4.0.6docs

New APIs and options 74

  • Adds a reason for a closed client, transport, or legacy HTTP session.

    4.0.6docs

  • Adds an event interface for comment text.

    4.0.6docs

  • Adds an unstable combinator that joins byte chunks into one new Uint8Array.

    4.0.6docs

  • Adds a reason for invalid client or toolkit options.

    4.0.6docs

  • Adds an event interface for the XML declaration at the start of a document.

    4.0.6docs

  • Adds a channel that parses UTF-8 bytes of one JSON document and emits the elements of one of its arrays.

    4.0.6docs

  • Creates a channel that decodes UTF-8 XML bytes into events.

    4.0.6docs

  • Adds options for JSON array decoding.

    4.0.6docs

  • Adds an interface for options for the XML decoders.

    4.0.6docs

  • Adds a channel that parses UTF-8 bytes of one JSON document and decodes array elements with a schema.

    4.0.6docs

  • Adds a channel that parses JSON document text and decodes array elements with a schema.

    4.0.6docs

  • Adds a channel that parses JSON document text and emits the elements of one of its arrays.

    4.0.6docs

  • Creates a channel that decodes XML text chunks into events.

    4.0.6docs

  • Adds an event interface for a document type declaration.

    4.0.6docs

  • Adds the element tree interface, including attributes and children, collected by elements.

    4.0.6docs

  • Creates a channel that collects the elements at a path into trees.

    4.0.6docs

  • Adds an interface for options for elements.

    4.0.6docs

  • Adds a channel that writes a stream of values as UTF-8 bytes of one JSON array.

    4.0.6docs

  • Creates a channel that writes events as UTF-8 XML bytes.

    4.0.6docs

  • Adds a channel that encodes values with a schema and writes them as UTF-8 bytes of one JSON array.

    4.0.6docs

  • Adds a channel that encodes values with a schema and writes them as the text of one JSON array.

    4.0.6docs

  • Adds a channel that writes a stream of values as the text of one JSON array.

    4.0.6docs

  • Creates a channel that writes events as XML text.

    4.0.6docs

  • Adds an event interface for an end tag.

    4.0.6docs

  • Adds an unstable instance for comparing byte sequences for equality, byte by byte.

    4.0.6docs

  • Adds the event type produced by decoders and consumed by encoders.

    4.0.6docs

  • Creates a Streamable HTTP transport with request-owned JSON or SSE responses.

    4.0.6docs

  • Adds a reason for non-success HTTP responses; JSON-RPC error bodies supply code, data, and description.

    4.0.6docs

  • Adds a guard that checks whether a value is a JsonArrayError.

    4.0.6docs

  • Returns whether a value is an MCP client.

    4.0.6docs

  • Adds a guard that checks whether a value is an McpClientError.

    4.0.6docs

  • Adds a guard that checks whether a value is an McpClientError reason.

    4.0.6docs

  • Adds a check for whether a value is an XmlError.

    4.0.6docs

  • Adds an error raised when JSON array encoding or decoding fails.

    4.0.6docs

  • Provides a connected MCP client over Streamable HTTP using the HTTP client.

    4.0.6docs

  • Provides a connected MCP client over stdio using the child process spawner.

    4.0.6docs

  • Adds a reason for a message or discovery scan exceeding a client limit.

    4.0.6docs

  • Constructs and connects a client using the supplied MCP transport service and its protocol adapter.

    4.0.6docs

  • Adds an interface for a scoped connection to one MCP server.

    4.0.6docs

  • Adds a service tag for applications that provide one default MCP connection.

    4.0.6docs

  • Adds an error type that wraps MCP client or transport failure reasons.

    4.0.6docs

  • Adds a union type for MCP client and transport failure reasons.

    4.0.6docs

  • Adds a schema for the reasons carried by an McpClientError.

    4.0.6docs

  • Adds an unstable instance that orders byte sequences lexicographically by unsigned byte value, placing a prefix before any longer sequence that starts with it.

    4.0.6docs

  • Adds an event interface for a processing instruction.

    4.0.6docs

  • Adds a reason for JSON-RPC errors or messages invalid for the selected protocol.

    4.0.6docs

  • Adds a type for supported MCP wire protocol revisions.

    4.0.6docs

  • Adds an event interface for a start tag, with attributes in document order.

    4.0.6docs

  • Starts a scoped subprocess using newline-delimited JSON-RPC.

    4.0.6docs

  • Adds an event interface for character data inside the root element.

    4.0.6docs

  • Adds a reason for an operation that does not complete within its deadline.

    4.0.6docs

  • Adds a reason for tool-reported execution errors and retains the complete result.

    4.0.6docs

  • Discovers remote tools and binds their handlers using the standard Toolkit implementation.

    4.0.6docs

  • Adds an interface for exchanging JSON-RPC messages with one MCP server using its protocol adapter.

    4.0.6docs

  • Adds a service supplied by the built-in MCP transport constructors and layers.

    4.0.6docs

  • Adds a reason for connection failures, including process or HTTP request start, write, read, or response-ending failures.

    4.0.6docs

  • Adds a reason for unsupported operations or tool results that cannot be converted for a language model.

    4.0.6docs

  • Adds a reason for request payloads, tool arguments, or results that fail schema validation.

    4.0.6docs

  • Adds an error raised when XML cannot be decoded or encoded.

    4.0.6docs

  • Creates a channel that decodes tar archive bytes into entries, streaming entry bodies from the archive input.

    4.0.5docs

  • Creates a directory entry.

    4.0.5docs

  • Creates a channel that encodes entries into tar archive bytes, streaming entry bodies back into archive bytes.

    4.0.5docs

  • Defines a tar entry as a header and a stream of exactly header.size body bytes.

    4.0.5docs

  • Provides options for the entry constructors.

    4.0.5docs

  • Defines the kind of filesystem object described by a tar entry.

    4.0.5docs

  • Creates a regular file entry from in-memory content.

    4.0.5docs

  • Creates a regular file entry whose content is streamed from body.

    4.0.5docs

  • Creates a hard link entry pointing at another entry of the archive.

    4.0.5docs

  • Defines metadata of a tar entry.

    4.0.5docs

  • Checks whether a value is a TarError.

    4.0.5docs

  • Creates a symbolic link entry pointing at target.

    4.0.5docs

  • Error raised when a tar archive cannot be encoded or decoded.

    4.0.5docs

  • Adds a layer that detects terminal capabilities from Stdio and the current ConfigProvider.

    4.0.0docs

  • Adds a service and interface for terminal rendering flags, including whether the current process can color, animate, or prompt.

    4.0.0docs

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.

    4.0.6docs

  • 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.

    4.0.2release notes

  • Unless a CliOutput.Formatter is provided, built-in help, version, and error output follows canColor.

    4.0.0docs

  • 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.

    4.0.0docs

Tooling 1

Fixes and other changes 4

  • Effects returned from beforeAll hooks are run with a Scope that closes when the suite finishes.

    4.0.6release notes

  • Effects returned from beforeEach hooks are run with a Scope that closes when the test finishes.

    4.0.6release notes

  • No longer throws a TypeError when no message is passed; shows the assertion diff instead.

    4.0.1release notes

  • No longer throws a TypeError when no message is passed; shows the assertion diff instead.

    4.0.1release notes