New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

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

npmnpm
Version
1.0.0-rc.4
Version published
Weekly downloads
6
-14.29%
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 04 Feb 2026

Related posts