Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vesln committed Dec 17, 2013
1 parent fee3657 commit 499e22f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

0.1.0 / 2013-12-17
==================

* Add support for plugins

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

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
all: test

# Make standalone browser build
# Standalone

browser: node_modules components
standalone: node_modules components
@./node_modules/.bin/component-build -s hydro-chai -o .
@mv build.js hydro-chai.js

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.4",
"version": "0.1.0",
"license": "MIT",
"main": "index.js",
"scripts": [
Expand Down
11 changes: 11 additions & 0 deletions hydro-chai.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ var chai = typeof root['chai'] === 'undefined'
* - styles: array/string should, expect, assert
* - stack: boolean include stack
* - diff: boolean show diff
* - plugins array list of chai.js plugins
*
* @param {Object} hydro
* @param {Object} util
Expand All @@ -228,6 +229,8 @@ var chai = typeof root['chai'] === 'undefined'
module.exports = function(hydro, util) {
var opts = hydro.get('chai') || {};
var styles = util.toArray(opts.styles);
var plugin = null;
opts.plugins = opts.plugins || [];

util.forEach(styles, function(style) {
switch (style) {
Expand All @@ -250,6 +253,14 @@ module.exports = function(hydro, util) {
if (opts.hasOwnProperty('diff')) {
chai.Assertion.showDiff = opts.diff;
}

for (var i = 0, len = opts.plugins.length; i < len; i++) {
plugin = typeof opts.plugins[i] === 'string'
? require(opts.plugins[i])
: opts.plugins[i];

chai.use(plugin);
}
};

});
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.4",
"version": "0.1.0",
"description": "Chai.js integration for hydro",
"main": "./index.js",
"homepage": "https://github.com/hydrojs/hydro-chai",
Expand Down

0 comments on commit 499e22f

Please sign in to comment.