Get started with chai CDN
MIT licensed
Chai is a flexible, modular JS assertion library for testing various kinds of code.
Tags:- test
- assertion
- assert
- testing
- chai
Stable version
Copied!
How to start using chai CDN
// Include Chai library from the CDN
const chai = require('chai');
const assert = chai.assert;
// Your test suite
describe('Simple Test Suite', () => {
it('should check if 1 is equal to 1', () => {
const num1 = 1;
const num2 = 1;
// Use Chai assertions
assert.strictEqual(num1, num2);
});
it('should check if a string is empty', () => {
const str = '';
// Use Chai assertions
assert.isEmpty(str);
});
it('should check if an array is empty', () => {
const arr = [];
// Use Chai assertions
assert.isEmpty(arr);
});
it('should check if a number is a multiple of another number', () => {
const num1 = 6;
const num2 = 3;
// Use Chai assertions
assert.isMultiple(num1, num2);
});
});
Copied!
All versions
0.0.1
0.0.2
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5
0.1.6
0.1.7
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.4.0
0.4.1
0.4.2
0.5.0
0.5.1
0.5.2
0.5.3
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.1.0
1.1.1
1.10.0
1.2.0
1.3.0
1.4.0
1.4.1
1.4.2
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7.2
1.8.0
1.8.1
1.9.0
1.9.1
1.9.2
2.0.0
2.1.0
2.1.1
2.1.2
2.2.0
2.3.0
3.0.0
3.1.0
3.2.0
3.3.0
3.4.0
3.4.1
3.5.0
4.0.0
4.0.0-canary.1
4.0.0-canary.2
4.0.1
4.0.2
4.1.0
4.1.1
4.1.2
4.2.0
4.3.0
4.3.1
4.3.10
4.3.2
4.3.3
4.3.4
4.3.5
4.3.6
4.3.7
4.3.8
4.3.9
4.4.0
4.4.1
4.5.0
5.0.0
5.0.0-alpha.0
5.0.0-alpha.1
5.0.0-alpha.2
5.0.0-rc.0
5.0.2
5.0.3
5.1.0
*** 5.1.1