Aliendreamer

odoreven unit test

Feb 22nd, 2019
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('isOddOrEven',function(){
  2.     it('with a number parameter should return undefined',function(){
  3.         expect(isOddOrEven(13)).to.equal(undefined,'Function did not return correct result!');
  4.     });
  5.  
  6.     it('with a object parameter should return undefined',function(){
  7.         expect(isOddOrEven({name:'pesho'})).to.equal(undefined,'Function did not return the correct result!');
  8.     });
  9.  
  10.     it('with an even length string should return correct result',function(){
  11.         assert.equal(isOddOrEven('roar'),'even','Function did not return the correct result!')
  12.     });
  13.  
  14.     it('with an even length string should return correct result',function(){
  15.         expect(isOddOrEven('pesho')).to.equal('odd','Function did not return the correct result!')
  16.     });
  17.  
  18.     it('with multiple consecutive checks, should return correct values',function(){
  19.         expect(isOddOrEven('cat')).to.equal('odd','Function did not return the correct result!');
  20.         expect(isOddOrEven('alabala')).to.equal('odd','Function did not return the correct result!');
  21.         expect(isOddOrEven('is it even')).to.equal('even','Function did not return the correct result!')
  22.     });
  23. });
Advertisement
Add Comment
Please, Sign In to add comment