Library for creating BDD-style test flows for JavaScript.
- Nested
describe()
- Optionally async
it()
andbefore/beforeEach/after/afterEach
hooks - Filter
it()
execution by regular expression - Manage
it()
and hook contexts with property injection/omission - Supply your own runner CLI, assertion library, etc.
API modeled after Mocha.
Ability to add BDD-style flow to new environments like CasperJS/PhantomJS, but integrate with preexisting assertion APIs, etc.
conjure
allows you to write modular tests in a BDD-style flow.
module.exports = function(conjure) {
conjure.set('initUrl', '/login').set('initSel', '.login');
conjure.test('login page', function() {
this.describe('form', function() {
this.it('should not auto-check "Remember Me"' , function() {
this.conjure.selectorExists('.remember-me');
this.conjure.selectorMissing('.remember-me:checked');
});
});
});
};
Standard CasperJS
APIs like casper
and utils
are injected into test method contexts using addContextProp().
flow = weir.create();
flow
.addRootDescribe('subject', function() {
this.it('should do X', function() {
// ...
});
})
.run();
flow = weir.create();
flow
.addRootDescribe('subject', function() {
this.beforeEach(function(done) {
this.fixture = 'foo';
done();
});
this.it('should receive fixture prepared by hook', function(done) {
// this.fixture still equals 'foo'
done();
});
})
.run();
MIT
npm test