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); });
    });

    Install

    npm i karma-jasmine-given

    DownloadsWeekly Downloads

    1,016

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • kirisu