- Greg Douglas
const { expect } = require('chai');
describe('foo', function() {
it('should do things', function() {
const foo = 'bar';
expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.lengthOf(3);
expect(foo).not.to.be.null;
});
});
/* expect available globally */
describe('foo', () => {
it('should do things', () => {
const foo = 'bar';
expect(typeof foo).toBe('string');
expect(foo).toEqual('bar');
expect(foo).toHaveLength(3);
expect(foo).not.toBeNull();
});
});