Advertisement
didkoslawow

Untitled

May 30th, 2023
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('TestForSymmetry function tests', () => {
  2.      it('Should return true if parameter is an Array', () => {
  3.          expect(isSymmetric([])).to.be.true;
  4.      });
  5.      it('Should return true if Array have one element', () => {
  6.          expect(isSymmetric([2])).to.be.true;
  7.      });
  8.      it('Should return true if array is symmetric', () => {
  9.          expect(isSymmetric([1,2,1])).to.be.true;
  10.      })
  11.      it('Should return false if array is not symmetric', () => {
  12.          expect(isSymmetric([1,2,2])).to.not.be.true;
  13.      })
  14.      it('Should return true if array of strings is symmetric', () => {
  15.          expect(isSymmetric(['1', '2', '1'])).to.be.true;
  16.      })
  17.      it('Should return false if array is mixed types', () => {
  18.          expect(isSymmetric(['1', 2, '1'])).to.be.true;
  19.      })
  20.      it('Should return false if array is mixed types', () => {
  21.          expect(isSymmetric(['2', 2,])).to.be.false;
  22.      })
  23.  
  24.      it('Should return false if parameter is object', () => {
  25.          expect(isSymmetric({})).to.not.be.true;
  26.      })
  27.      it('Should return false if parameter is string', () => {
  28.          expect(isSymmetric('')).to.not.be.true;
  29.      })
  30.      it('Should return false if parameter is number', () => {
  31.          expect(isSymmetric(1)).to.not.be.true;
  32.      })
  33.      it('Should return false if parameter is undefined', () => {
  34.          expect(isSymmetric(undefined)).to.not.be.true;
  35.      })
  36.      it('Should return false if parameter is null', () => {
  37.          expect(isSymmetric(null)).to.not.be.true;
  38.      })
  39.      it('Should return false if parameter is true', () => {
  40.          expect(isSymmetric(true)).to.not.be.true;
  41.      })
  42.      it('Should return false if parameter is false', () => {
  43.          expect(isSymmetric(false)).to.not.be.true;
  44.      })
  45.      it('Should return false if there is no parameter', () => {
  46.          expect(isSymmetric()).to.not.be.true;
  47.      })
  48.  });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement