Skip to content

Commit

Permalink
add chai global options
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalparadox committed Jan 24, 2014
1 parent 957374e commit 616e156
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hydro.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = function(hydro) {
styles: ['expect', 'assert', 'should'],
plugins: ['chai-spies'],
diff: true,
stack: true
stack: true,
global: true
},
attach: global,
proxies: {
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = function(hydro, util) {
chai.Assertion.showDiff = opts.diff;
}

if (opts.hasOwnProperty('global')) {
hydro.set('globals', 'chai', chai);
}

for (var i = 0, len = opts.plugins.length; i < len; i++) {
chai.use(loa(opts.plugins[i]));
}
Expand Down
4 changes: 3 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var chai = require('chai');
test('global', function() {
sassert(chai);
});

test('styles', function() {
sassert(should);
Expand Down

0 comments on commit 616e156

Please sign in to comment.