This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

karma-jasmine-given

0.1.1 • Public • Published

karma-jasmine-given

Installation

$ npm install karma-jasmine-given --save-dev

Add jasmine-given to the frameworks key in your Karma configuration, before jasmine:

module.exports = function(config) {
  config.set({
    frameworks: ['jasmine-given', 'jasmine']
  });
}

Usage

Given-When-Then DSL is now available in your tests:

describe("assigning stuff to this", function() {
  Given(function() { this.number = 24; });
  Given(function() { this.number++; });
  When(function() { this.number *= 2; });
  Then(function() { return this.number === 50; });
  // or
  Then(function() { expect(this.number).toBe(50) });
});
 
describe("assigning stuff to variables", function() {
  var subject;
  Given(function() { subject = []; });
  When(function() { subject.push('foo'); });
  Then(function() { return subject.length === 1; });
  // or
  Then(function() { expect(subject.length).toBe(1); });
});

Dependents (0)

Package Sidebar

Install

npm i karma-jasmine-given

Weekly Downloads

346

Version

0.1.1

License

MIT

Last publish

Collaborators

  • kirisu