Advertisement
fbinnzhivko

Untitled

Nov 1st, 2016
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('test cases for lookupChar(str, index) function', function () {
  2.     it('should return undefined on lookupChar(2, 2)', () => {
  3.         expect(lookupChar(2, 2)).to.equal(undefined);
  4.     });
  5.  
  6.     it('should return undefined on lookupChar("test", "2")', () => {
  7.         expect(lookupChar("test", "2")).to.equal(undefined);
  8.     });
  9.  
  10.     it('should return undefined on lookupChar("test", 1.23)', () => {
  11.         expect(lookupChar("test", 1.23)).to.equal(undefined);
  12.     });
  13.  
  14.     it('should return Incorrect index on lookupChar("test", 25)', () => {
  15.         expect(lookupChar("test", 25)).to.equal('Incorrect index');
  16.     });
  17.  
  18.     it('should return Incorrect index on lookupChar("hello", -4)', () => {
  19.         expect(lookupChar("hello", -4)).to.equal('Incorrect index');
  20.     });
  21.  
  22.     it('should return Incorrect index on lookupChar("hello", 5)', () => {
  23.         expect(lookupChar("hello", 5)).to.equal('Incorrect index');
  24.     });
  25.  
  26.     it('should return "o" on lookupChar("hello", 4)', () => {
  27.         expect(lookupChar("hello", 0)).to.equal('o');
  28.     });
  29.  
  30.     it('should return "l" on lookupChar("hello", 3)', () => {
  31.         expect(lookupChar("hello", 3)).to.equal('l');
  32.     });
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement