Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Add BDD style #4

Open
munierujp opened this issue Aug 31, 2018 · 0 comments
Open

Add BDD style #4

munierujp opened this issue Aug 31, 2018 · 0 comments

Comments

@munierujp
Copy link
Member

like this:

  describe('Array', function() {
    before(function() {
      // ...
    });

    describe('#indexOf()', function() {
      context('when not present', function() {
        it('should not throw an error', function() {
          (function() {
            [1,2,3].indexOf(4);
          }).should.not.throw();
        });
        it('should return -1', function() {
          [1,2,3].indexOf(4).should.equal(-1);
        });
      });
      context('when present', function() {
        it('should return the index where the element first appears in the array', function() {
          [1,2,3].indexOf(3).should.equal(2);
        });
      });
    });
  });
@munierujp munierujp mentioned this issue Aug 31, 2018
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant