Skip to content

Releases: stalniy/bdd-lazy-var

v2.6.1

14 Mar 14:27
Compare
Choose a tag to compare

2.6.1 (2021-03-14)

v2.6.0

10 Dec 13:04
Compare
Choose a tag to compare

2.6.0 (2020-12-10)

Features

  • sharedBehavior: adds possibility to pass function in (3e2196f)

Shortcuts

16 Jul 10:55
Compare
Choose a tag to compare

The main purpose of this release was to add shortcuts its and it without a message. This allows to write subject specific tests easier.

Features

  • interface: adds support for its
  • interface: adds support for it without a message
describe('Array', () => {
  subject(() => [1, 2, 3])

  its('length', () => is.expected.to.equal(3))
  it(() => is.expected.to.be.an('array'))
})

Scoped Shared Examples

16 Jul 10:39
Compare
Choose a tag to compare

The main purpose of this release was to add scoping to sharedExamplesFor. Previously that function defined shared examples globally, from this release it defines them in scope of suite where it was called.

Features

  • shared-examples: adds support for scoping
describe('Array', () => {
  subject(() => [1, 2, 3])

  sharedExamplesFor('a collection', () => {
     it('has 3 items', () => expect($subject).to.have.length(3))
  })

  includeExamplesFor('a collection')
})

describe('Set', () => {
  subject(() => new Set([1, 2, 3]))

  sharedExamplesFor('a collection', () => {
     it('has 3 items', () => expect($subject.size).to.equal(3))
  })

  includeExamplesFor('a collection')
})

Shared Examples

11 Mar 10:55
Compare
Choose a tag to compare

The main purpose of this release was bug fixes after massive refactoring and new shared behavior feature

Features

  • ui: adds shared behavior

Bug fixes

  • variable: fixes access to parent variable inside child override definition
  • metadata: fixes metadata inheritance when for contexts without lazy vars
  • get: returns undefined when variable does not exist @iain-b

Performance

  • variable: decreases amount of afterEach callbacks. Now there is a single afterEach on root level instead of a single afterEach for each describe/context
sharedExamplesFor('a collection', () => {
  it('has three items', () => {
    expect($subject.size).to.equal(3)
  })

  describe('#has', () => {
    it('returns true with an an item that is in the collection', () => {
      expect($subject.has(7)).to.be.true
    })

    it('returns false with an an item that is not in the collection', () => {
      expect($subject.has(9)).to.be.false
    })
  })
})

describe('Set', () => {
  subject(() => new Set([1, 2, 7]))

  itBehavesLike('a collection')
})

describe('Map', () => {
  subject(() => new Map([[2, 1], [7, 5], [3, 4]]))

  itBehavesLike('a collection')
})

2.1.0 Jest support

09 Jan 17:28
Compare
Choose a tag to compare

The main purpose of this release was support for Jest framework

Features

  • ui: adds support for jest
  • interface: exports get and def functions from every dialect file. So, now it's possible to write tests as this:
const { def, subject } = require('bdd-lazy-var/global')

describe('Suite', () => {
  def('suite', () => new Suite())

  it('has parent', () => {
    expect($suite).to.have.property('parent')
  })
})

2.0.0 Universal Lazy Vars

09 Jan 11:31
Compare
Choose a tag to compare

2.0.0 (2018-01-09)

The main purpose of this release was a goal to refactor package, so that it's possible to add support for other testing frameworks like jasmine

Features

  • interface: adds support for jasmine testing framework

Documentation

  • README: updates documentation to clearly reflect the purpose of the project

Breaking Changes

  • interface: rspec is no longer available. Currently all interfaces work according to rspec flow execution. If you used bdd-lazy-var/rspec just replace it with bdd-lazy-var/global