
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
assertion-error
Advanced tools
Error constructor for test and validation frameworks that implements standardized AssertionError specification.
AssertionError and AssertionResult classes.
Assertion Error is a module that contains two classes: AssertionError, which
is an instance of an Error, and AssertionResult which is not an instance of
Error.
These can be useful for returning from a function - if the function "succeeds"
return an AssertionResult and if the function fails return (or throw) an
AssertionError.
Both AssertionError and AssertionResult implement the Result interface:
interface Result {
name: "AssertionError" | "AssertionResult";
ok: boolean;
toJSON(...args: unknown[]): Record<string, unknown>;
}
So if a function returns AssertionResult | AssertionError it is easy to check
which one is returned by checking either .name or .ok, or check
instanceof Error.
assertion-error is available on npm.
$ npm install --save assertion-error
assertion_error is available on
Deno.land
import {
AssertionError,
AssertionResult,
} from "https://deno.land/x/assertion_error@2.0.0/mod.ts";
Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework. It offers more comprehensive features for assertions compared to assertion-error, including a range of assertion styles (expect, should, assert) and numerous plugins.
Should.js is an expressive, readable, framework-agnostic assertion library. The key difference is that should.js provides a rich set of assertions and chainable methods to construct assertions, whereas assertion-error is focused on creating error objects for failed assertions.
Expect.js is a minimalistic BDD-style assertions library that can be used in node.js or in the browser. It provides a similar set of assertion checks as assertion-error but with a different API and additional features like chainable assertions.
FAQs
Error constructor for test and validation frameworks that implements standardized AssertionError specification.
The npm package assertion-error receives a total of 11,478,148 weekly downloads. As such, assertion-error popularity was classified as popular.
We found that assertion-error demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.