Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,43 @@ As part of the Mono-Repo it also provides some shim implementations which are de
- **Custom error messages** - all assertions support optional custom messages
- **Full negation support** - consistent `not` operator across all assertion types

## API Documentation
## Documentation

The API documentation is generated from the source code via typedoc and is located [here](https://nevware21.github.io/tripwire/index.html)
**Main Documentation Site**: [https://nevware21.github.io/tripwire](https://nevware21.github.io/tripwire)

The documentation site includes:
- Quick start guides and usage examples
- Feature highlights and comparison tables
- Migration guides (e.g., from Chai.js)
- Detailed guides for specific features (like change/increase/decrease assertions)
- Links to full TypeDoc API reference for each module

**API Reference (TypeDoc)**:
- [Core Module API](https://nevware21.github.io/tripwire/typedoc/core/index.html)
- [Chai Shim API](https://nevware21.github.io/tripwire/typedoc/shim/chai/index.html)

## Quick Start

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

> Recommended: Use the following definition in your `package.json` to stay compatible with future releases.
> We do not intend to make runtime / environment breaking changes until at least v2.x
> ```json
> "@nevware21/tripwire": ">= 0.1.4 < 2.x"
> ```

## Usage

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

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

assert.isObject([]); // throws

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

# Modules

Expand Down Expand Up @@ -69,29 +103,6 @@ As part of this the returned "error messages" do not and will not match the asse

As of the initial version not all functions are yet implemented

## Quick Start

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

> Recommended: Use the following definition in your `package.json` to stay compatible with future releases.
> We do not intend to make runtime / environment breaking changes until at least v2.x
> ```json
> "@nevware21/tripwire": ">= 0.1.4 < 2.x"
> ```

## Usage

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

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

assert.isObject([]); // throws

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

## Browser Support

General support is currently set to ES5 supported runtimes and higher.
Expand Down
22 changes: 11 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@

[Core Assertion Typedoc](https://nevware21.github.io/tripwire/typedoc/core/index.html)

### Feature Highlights

| Feature | Functions |
|---------|-----------|
| **Type Checking** | [`isObject`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isobject), [`isArray`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isarray), [`isString`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isstring), [`isNumber`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnumber), [`isBoolean`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isboolean), [`isFunction`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isfunction), [`isNull`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnull), [`isUndefined`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isundefined), [`isNaN`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnan), [`isFinite`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isfinite), [`typeOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#typeof), [`isInstanceOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isinstanceof), [`exists`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#exists) |
| **Equality & Comparison** | [`equal`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#equal), [`strictEqual`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#strictequal), [`deepEqual`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#deepequal), [`closeTo`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#closeto), [`isAbove`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isabove), [`isBelow`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isbelow), [`isWithin`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#iswithin), [`isAtLeast`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isatleast), [`isAtMost`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isatmost) |
| **Property Assertions** | [`hasProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasproperty), [`hasOwnProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasownproperty), [`hasDeepProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasdeepproperty), [`nestedProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#nestedproperty), [`deepNestedProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#deepnestedproperty) |
| **Collection Operations** | [`includes`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#includes), [`sameMembers`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#samemembers), [`includeMembers`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#includemembers), [`lengthOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#lengthof), [`sizeOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#sizeof) |
| **Change Tracking** | [`changes`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#changes), [`increases`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#increases), [`decreases`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#decreases) - See [Change/Increase/Decrease Assertions Guide](change-assertions.md) |
| **Error Testing** | [`throws`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#throws), [`doesNotThrow`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#doesnotthrow) |

### Quick Start

Install the package:
Expand Down Expand Up @@ -48,17 +59,6 @@ expect("hello").to.be.a.string;
expect({ a: 1 }).to.deep.equal({ a: 1 });
```

### Feature Highlights

| Feature | Functions |
|---------|-----------|
| **Type Checking** | [`isObject`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isobject), [`isArray`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isarray), [`isString`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isstring), [`isNumber`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnumber), [`isBoolean`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isboolean), [`isFunction`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isfunction), [`isNull`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnull), [`isUndefined`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isundefined), [`isNaN`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isnan), [`isFinite`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isfinite), [`typeOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#typeof), [`isInstanceOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isinstanceof), [`exists`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#exists) |
| **Equality & Comparison** | [`equal`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#equal), [`strictEqual`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#strictequal), [`deepEqual`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#deepequal), [`closeTo`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#closeto), [`isAbove`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isabove), [`isBelow`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isbelow), [`isWithin`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#iswithin), [`isAtLeast`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isatleast), [`isAtMost`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#isatmost) |
| **Property Assertions** | [`hasProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasproperty), [`hasOwnProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasownproperty), [`hasDeepProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#hasdeepproperty), [`nestedProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#nestedproperty), [`deepNestedProperty`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#deepnestedproperty) |
| **Collection Operations** | [`includes`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#includes), [`sameMembers`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#samemembers), [`includeMembers`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#includemembers), [`lengthOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#lengthof), [`sizeOf`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#sizeof) |
| **Change Tracking** | [`changes`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#changes), [`increases`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#increases), [`decreases`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#decreases) - See [Change/Increase/Decrease Assertions Guide](change-assertions.md) |
| **Error Testing** | [`throws`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#throws), [`doesNotThrow`](https://nevware21.github.io/tripwire/typedoc/core/interfaces/IAssertClass.html#doesnotthrow) |

## Shim Chai

[![npm version](https://badge.fury.io/js/%40nevware21%2Ftripwire-chai.svg)](https://badge.fury.io/js/%40nevware21%2Ftripwire-chai)
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-midnight
theme: jekyll-theme-hacker