Skip to content

Releases

v2.6.4

Choose a tag to compare

@searls searls released this 11 Jan 21:34

2.6.3

Choose a tag to compare

@searls searls released this 02 May 20:01
  • Support 'use strict'

2.6.2

Choose a tag to compare

@searls searls released this 15 May 18:50
  • Include dist/ in the npm slug #34

2.6.1

Choose a tag to compare

@searls searls released this 14 Feb 18:02
  • Updates jasmine-matcher-wrapper@0.0.3

2.6.0

Choose a tag to compare

@searls searls released this 21 Jan 23:26
  • Adds support for Jasmine 2.0.0

2.5.1

Choose a tag to compare

@searls searls released this 23 Nov 20:05
  • Fixes a bug with Invariant being called from the wrong context.

Improved Async Support

Choose a tag to compare

@searls searls released this 20 Nov 22:19
  • 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!

Choose a tag to compare

@searls searls released this 19 Sep 21:24

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

Choose a tag to compare

@searls searls released this 16 Sep 22:14
  • 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

Choose a tag to compare

@searls searls released this 11 Sep 22:29
  • 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