Socket
Book a DemoInstallSign in
Socket

@nevware21/tripwire

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nevware21/tripwire

Test Support utilities, helpers, tools for testing in JavaScript and TypeScript.

0.1.2
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

Core Module

GitHub Workflow Status (main) codecov npm version downloads downloads

This is the core module of the tripwire project which is designed to be used for testing your Javascript or TypeScript packages.

It is designed to work in and is tested with the following environments.

  • node
  • browser
  • worker (browser)

It currently provides assertion functions to make testing simplier and easier by providing common assertion checks that you can run against your code.

It provides both assert and expect support, where the assert functions are a set of fixed operations, which the expect is a more descriptive language API.

The assert functions are built on-top of the underlying expect support, and if no assertions are thrown the result of the internal "chained" descriptive language API is returned. Which means you can mix the expect objects with the responses from the assert functions.

To avoid dependency issues, this project will use the mininal set of external dependencies so that it can ensure and maintain compatibility with current (and future) runtimes.

API Documentation

The API documentation is generated from the source code via typedoc and is located here

Quick Start

Install the npm packare: npm install @nevware21/tripwire --save-dev

It is suggested / recommended that you use the following definition in your package.json so that you are compatible with any future releases as they become available we do not intend to make ANY known breaking changes moving forward until v2.x

"@nevware21/tripwire": ">= 0.1.2 < 2.x"

Usage

To use the core functionalities, import the necessary modules and functions:

import { assert, expect } from '@nevware21/tripwire';

assert.isObject([]); // throws

expect(() => { dosomething(); }).to.not.throw();
expect(() => { throw new Error("failed")}).to.throw();

API Documentation

The API documentation is generated from the source code via typedoc and is located here

Browser Support

General support is currently set to ES5 supported runtimes and higher.

This module uses @nevware21/ts-utils to provide some of it core functionality which includes internal polyfills to provide support on older browsers.

While every effort will be made to maintain as much technical compatibility as possible, some assertions and functionality will require later browsers to function correctly.

Contributing

Read our primary contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

test

FAQs

Package last updated on 01 Apr 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.