Skip to content

Commit

Permalink
Release 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vesln committed Dec 13, 2013
1 parent 2e3a783 commit 77c6927
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

0.0.4 / 2013-12-13
==================

* Improve browser support

0.0.3 / 2013-12-13
==================

Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "hydro-chai",
"repo": "hydrojs/hydro-chai",
"description": "Chai.js integration for hydro",
"version": "0.0.3",
"version": "0.0.4",
"license": "MIT",
"main": "index.js",
"scripts": [
Expand Down
17 changes: 11 additions & 6 deletions hydro-chai.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ require.register("hydro-chai/index.js", function(exports, require, module){
* External dependencies.
*/

var chai = global.chai || require('chai');
var root = this;

var chai = typeof root['chai'] === 'undefined'
? require('chai')
: root['chai'];

/**
* Chai.js plugin.
Expand All @@ -217,15 +221,16 @@ var chai = global.chai || require('chai');
* - diff: boolean show diff
*
* @param {Object} hydro
* @param {Object} util
* @api public
*/

module.exports = function(hydro) {
module.exports = function(hydro, util) {
var opts = hydro.get('chai') || {};
var styles = !Array.isArray(opts.styles) ? [opts.styles] : opts.styles;
var styles = util.toArray(opts.styles);

for (var i = 0, len = styles.length; i < len; i++) {
switch (styles[i]) {
util.forEach(styles, function(style) {
switch (style) {
case 'expect':
hydro.set('globals', 'expect', chai.expect);
break;
Expand All @@ -236,7 +241,7 @@ module.exports = function(hydro) {
hydro.set('globals', 'assert', chai.assert);
break;
}
}
});

if (opts.hasOwnProperty('stack')) {
chai.Assertion.includeStack = opts.stack;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hydro-chai",
"version": "0.0.3",
"version": "0.0.4",
"description": "Chai.js integration for hydro",
"main": "./index.js",
"homepage": "https://github.com/hydrojs/hydro-chai",
Expand Down

0 comments on commit 77c6927

Please sign in to comment.