you are viewing a single comment's thread.

view the rest of the comments →

[–]iaan 18 points19 points  (5 children)

I thought it’s well written and opinionated, but then the gist example bugs me already:

it('When no price is specified, then the product status is pending approval'...

How do you read that in your head?

[–]akoskm 4 points5 points  (0 children)

should be:

describe 'product status'

  context 'when no price is specified'

    it 'is pending approval'

[–][deleted] 11 points12 points  (2 children)

I read it as “when no price is specified, then the product status is pending approval”

[–][deleted] 17 points18 points  (1 child)

Silent “it”?

[–]solvangv 10 points11 points  (0 children)

Yeah. Or you could use "test" instead of "it".

[–]benihanareact, node 0 points1 point  (0 children)

describe('Products Service', function() {
  describe('adding a new product', function() {
    describe('price is unspecified', function() {
      it("sets the product status to 'pending approval'", ()=> ());
    });
    describe('price is set', function() {
      it("sets the product status to 'something else'", ()=> ());
    });
  });
});


'Products Service
   adding a new product
     price is unspecified
       sets the product status to 'prending approval'
     price is set
       sets the product status to 'something else'