Releases: stalniy/bdd-lazy-var
Releases · stalniy/bdd-lazy-var
v2.6.1
v2.6.0
Shortcuts
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
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
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 singleafterEach
on root level instead of a singleafterEach
for eachdescribe/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
The main purpose of this release was support for Jest framework
Features
- ui: adds support for jest
- interface: exports
get
anddef
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
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 usedbdd-lazy-var/rspec
just replace it withbdd-lazy-var/global