diff --git a/README.md b/README.md index c3d9a89..631efdc 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/docs/README.md b/docs/README.md index 6242d1c..a8d735d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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: @@ -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) diff --git a/docs/_config.yml b/docs/_config.yml index 1885487..fc24e7a 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-midnight \ No newline at end of file +theme: jekyll-theme-hacker \ No newline at end of file