stalniy / bdd-lazy-var

Provides UI for testing frameworks such as mocha, jasmine and jest which allows to define lazy variables and subjects.
MIT License
162 stars 14 forks source link

Implement support for global getters #1

Closed stalniy closed 8 years ago

stalniy commented 8 years ago

As an developer I want to use global getters So that, I can write cleaner code

def('username', 'admin');

it('defines getter on global scope', function() {
  expect(username).to.equal('admin');
});
stalniy commented 8 years ago

in order to avoid naming collisions it's better add some prefix to each defined global variable, something like $. So,

subject(function() {
  return new Object()
});

it('is accessible via $subject', function() {
  expect($subject).to.be.an('object');
});