DescriptionSet up mocha, chai and karma for sheriff-o-matic unit testing.
This is the first step in switching to the mocha testing framework.
We'll use the Chai assertion library, which provides should-style,
expect-style, and assert-style assertions. We should avoid 'should',
since it modifies Object.prototype. 'expect' is more readable and
flexible than 'assert', although the (optional) chaining keywords can
make it overly verbose. For a full comparison, see:
http://chaijs.com/guide/styles/
I've used 'expect' in the two example tests, but left out the unnecessary
chaining keywords. This makes the most sense to me but feel free to
disagree.
Finally, Karma is a test runner that allows us to remotely run unit tests
in Chrome from the command line. We may need to use some trickery to have
this work for both Chrome and Chromium, but that is for another patch.
R=esprehn@chromium.org,ojan@chromium.org
NOTRY=true
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179075
Patch Set 1 : #
Total comments: 31
Patch Set 2 : switch to BDD and assert #Patch Set 3 : rm head/body tag #
Messages
Total messages: 16 (0 generated)
|