🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@autometa/assertions

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@autometa/assertions

Runner-agnostic assertion helpers powered by ensure(value) matcher chains.

latest
npmnpm
Version
1.0.0-rc.5
Version published
Weekly downloads
25
316.67%
Maintainers
1
Weekly downloads
 
Created
Source

@autometa/assertions

Autometa's assertion toolkit built around the ensure(value) entry point. The package provides a fluent matcher chain with TypeScript-aware narrowing so you can write expressive assertions across runners without depending on Jest/Vitest globals.

import { ensure } from "@autometa/assertions";

const result: string | undefined = fetchName();

const narrowed = ensure(result, { label: "result" })
	.toBeDefined()
	.toBeInstanceOf(String)
	.value;

ensure({ count: 1, name: "Foo" }).toBeObjectContaining({ name: "Foo" });
ensure([1, 2, 3]).toBeArrayContaining([2]);
ensure(new Set([1, 2, 3])).toBeIterableContaining([3]);
ensure("text").toHaveLength(4);

FAQs

Package last updated on 09 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts