updeep-remeda/test/constant-spec.js
Aaron Jensen 0cf608c2c4 Revert "Replace chai with expect"
This reverts commit f7e570934d.

Fixes #30
2015-08-19 00:24:32 -07:00

18 lines
425 B
JavaScript

import { expect } from 'chai';
import u from '../lib';
describe('u.constant', () => {
it('returns what it is given... constantly', () => {
const func = u.constant(4);
expect(func()).to.equal(4);
expect(func('hi')).to.equal(4);
expect(func('hi', 8)).to.equal(4);
expect(func(4)).to.equal(4);
});
it('freezes the result', () => {
expect(Object.isFrozen(u.constant({})())).to.be.true;
});
});