Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Add and subtract', () => {
- it('Should contain add, subtract, get', () => {
- let returnValue = createCalculator();
- expect(returnValue).to.haveOwnProperty('add');
- expect(returnValue).to.haveOwnProperty('subtract');
- expect(returnValue).to.haveOwnProperty('get');
- });
- it('Should not take any parameters', () => {
- let obj = createCalculator();
- obj.add(5);
- obj.add(5);
- let returnValue = obj.get();
- expect(returnValue).to.equal(10);
- });
- it('Should be a number', () => {
- let obj = createCalculator();
- obj.add('sss');
- obj.subtract('dssa');
- let returnValue = obj.get();
- expect(returnValue).to.be.NaN;
- });
- it('Should return the variable value', () => {
- expect(createCalculator().get()).to.equal(0);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement