Mocha tests are just JS code, so you can do all the usual things. But I usually try to keep tests as linear as possible so that they are clear to read.
--
You received this message because you are subscribed to a topic in the Google Groups "Mocha" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mochajs/lj7GQnAk2_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mochajs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
it('works for enabled items', function() {var item = new Item({enabled: true})var expectedState = 'the expected state of an enabled item';expect(item.getState()).to.equal(expectedState);});it('works for disabled items', function() {var item = new Item({enabled: false})var expectedState = 'the expected state of a disabled item';expect(item.getState()).to.equal(expectedState);});
describe('strlen', function() {var outputPerInput = {'tdd': 3,'expectance': 10,'': 0};for (input in outputPerInput) {it('returns the appropriate string length', function() {var expectedResult = outputPerInput[input];expect(strlen(input)).to.equal(expectedOutput);});}});