Skip to content

Releases: searls/jasmine-given

v2.6.4

11 Jan 21:34
Compare
Choose a tag to compare

2.6.3

02 May 20:01
Compare
Choose a tag to compare
  • Support 'use strict'

2.6.2

15 May 18:50
Compare
Choose a tag to compare
  • Include dist/ in the npm slug #34

2.6.1

14 Feb 18:02
Compare
Choose a tag to compare
  • Updates jasmine-matcher-wrapper@0.0.3

2.6.0

21 Jan 23:26
Compare
Choose a tag to compare
  • Adds support for Jasmine 2.0.0

2.5.1

23 Nov 20:05
Compare
Choose a tag to compare
  • Fixes a bug with Invariant being called from the wrong context.

Improved Async Support

20 Nov 22:19
Compare
Choose a tag to compare
  • jasmine-given's async support (for runners like karma and minijasminenode) has been improved to also allow done() calls for When, Invariant, and And statements. It accomplishes this by aggregating its own callbacks separately from whatever done callback is provided by the Jasmine runner that supports it. See 8ced259 for info.

Comparison Insights!

19 Sep 21:24
Compare
Choose a tag to compare

This release drastically improves output of tests that use comparators in Then statements to determine if the test passes. Previously, the error message would simply say that the statement returned false, now it'll detect comparisons and evaluate both sides and print them out (so long as both sides are eval-able and don't result in ReferenceErrors).

Here's an example:

context "simple !== matcher", ->
  Given -> @a = -> 1
  Given -> @b = 3
  Then -> @a() == @b

This will produce output like this:

Then clause `this.a() === this.b` failed by returning false

This comparison was detected:
  this.a() === this.b
  1 === 3

Similarly, if the two sides had deep-equalled each other, jasmine-given can now warn you that you should be using the toEqual matcher:

context "simple !== matcher", ->
  Given -> @a = -> [1]
  Given -> @b = [1]
  Then -> @a() == @b

Which will advise:

Then clause `this.a() === this.b` failed by returning false

This comparison was detected:
  this.a() === this.b
  1 === 1

However, these items are deeply equal! Try an expectation like this instead:
  expect(this.a()).toEqual(this.b)

Neat!

Keep in mind that this will result in a bunch of less-than-helpful ReferenceErrors if your Then statements are comparing things that aren't reachable by this or by global scopes. If both sides result in a reference error, jasmine-given will (╯°□°)╯︵ ┻━┻ and just continue doing what it always has.

2.3.0

16 Sep 22:14
Compare
Choose a tag to compare
  • Add "done" support for jasmine-node and minijasmiennode and folks using @derickbailey's Jasmine.Async to Given and Then. No such support for will be available for When because of good reasons.

2.2.0

11 Sep 22:29
Compare
Choose a tag to compare
  • Then.only support for jasmine environments (like Karma, Protractor, and jasmine-only) which provide an it.only mechanism for running only a single test. If it.only isn't defined, the spec will explode ungracefully.
  • Fixes Invariant such that a false return value will fail a test