Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 20, 2024 via pnpm

chai 3.3.0

BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
Package summary
Share
0
issues
1
license
5
MIT
Package created
7 Dec 2011
Version published
21 Sep 2015
Maintainers
2
Total deps
5
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
assertion-error@1.1.0
chai@3.3.0
deep-eql@0.1.3
type-detect@0.1.1
type-detect@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of chai 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
assertion-error1.1.02.61 kBMIT
prod
deep-eql0.1.33.65 kBMIT
prod
type-detect1.0.04.71 kBMIT
prod

Visualizations

Frequently Asked Questions

What does chai do?

Chai is a Behavior-Driven Development (BDD) and Test-Driven Development (TDD) assertion library for Node.js and the browser. It can be delightfully paired with any JavaScript testing framework. As an assertion library, similar to Node's built-in assert, Chai provides developers with a range of assertions that can be used to test the code base, making testing much easier.

How do you use chai?

Chai can be installed and used in a Node.js environment or within the browser. For Node.js, it can be installed using npm with the command $ npm install --save-dev chai. After installation, you can import Chai into your code with var chai = require('chai'). Chai provides three styles of assertions - assert, expect, and should. For example, you can use Chai's assert-style assertions in your code like this:

var chai = require('chai');  
var assert = chai.assert;

assert.equal(foo, 'bar', 'foo equals bar');

For browser usage, you can install it via npm and use the chai.js file found within the download. For example:

<script src="./node_modules/chai/chai.js"></script>

Where are the chai docs?

The comprehensive documentation for Chai can be found at http://chaijs.com. The documentation includes installation instructions, detailed usage guides highlighting the three styles of assertions (Assert, Expect, and Should), and also information on how to build a plugin or to find the appropriate plugin from the official plugin list. You can learn more about Chai's robust Plugin architecture which enables you to extend Chai's assertions and interfaces. The documentation is an excellent resource to get started with Chai and to dive deeper into this assertion library.