karma-jasmine-def
0.1.0 • Public • Published karma-jasmine-def
Adds def
and subject
functions - a better way to setup Jasmine test subjects.
Usage
Install
npm install karma-jasmine karma-jasmine-def --save-dev
Configure Karma
module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'jasmine-def']
});
};
Write specs
describe('a cleaner spec with lazy test subjects', function () {
subject(function () {
return new SomeObject(this.options);
});
def('options', function () {
return { foo: 'foo' };
});
it('works', function () {
expect(this.options).toBeDefined();
expect(this.subject).toBeDefined();
});
});
Versions
Version | Downloads (Last 7 Days) | Tag |
---|
0.1.0 | 330 | latest |
Version History
Version | Downloads (Last 7 Days) | Published |
---|
0.1.0 | 330 | |
Package Sidebar
Install
Weekly Downloads