Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("Test passed string parameter's length if it is even or odd", () => {
- describe('Test if function process invalid parameter', () => {
- it('Should return undefined if parameter is array', () => {
- expect(isOddOrEven([1, 2, 3])).to.be.undefined;
- });
- it('Should return undefined if parameter is object', () => {
- expect(isOddOrEven({ test: 'test' })).to.be.undefined;
- });
- it('Should return undefined if parameter is number', () => {
- expect(isOddOrEven(123)).to.be.undefined;
- });
- });
- describe('Test if function process valid parameter', () => {
- it("Should return 'odd' if parameter is 'bunny'", () => {
- expect(isOddOrEven('bunny')).to.equal('odd');
- });
- it("Should return 'even' if parameter is 'bunny and foxy'", () => {
- expect(isOddOrEven('bunny and foxy')).to.equal('even');
- });
- it("Should return 'even' if parameter is empty string", () => {
- expect(isOddOrEven('')).to.equal('even');
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement