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.subtract(3);
- let returnValue = obj.get();
- expect(returnValue).to.equal(2);
- });
- 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 parse this - "12"', () => {
- let obj = createCalculator();
- obj.add('8');
- obj.subtract('5');
- let returnValue = obj.get();
- expect(returnValue).to.equal(3);
- });
- it('Should work with different input', () => {
- let obj = createCalculator();
- obj.add(8);
- obj.subtract('5');
- let returnValue = obj.get();
- expect(returnValue).to.equal(3);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement