Tests work with webpack and a new favicon

This commit is contained in:
2016-02-28 18:34:11 +08:00
parent 844ef71cdb
commit 2a02b4e69f
95 changed files with 1429 additions and 1864 deletions
+12 -3
View File
@@ -1,9 +1,18 @@
// polyfill and conditional import so this will load in the browser too
if (!module) module=function(){};
var chai;
if (!chai){
chair = require("chai");
}
/**
* Rules objects for game
* @param {[type]} function functionName( [description]
* @return {[type]} [description]
*/
var chai = require("chai");
var Rules = module.exports = (function functionName(_,chai) {
@@ -64,12 +73,12 @@ var Rules = module.exports = (function functionName(_,chai) {
var reason;
try {
result = this.ruleFunc(card, lastCards, allCards, this.options);
if (result instanceof chai.Assertion) {
if ((chai&&result instanceof chai.Assertion)||result.name==='Assertion'||result.constructor.name==='Assertion') {
reason = result;
result = true;
}
} catch (e) {
if (e instanceof chai.AssertionError) {
if ((chai&&e instanceof chai.AssertionError)||e.name=='AssertionError') {
result = false;
reason = e;
} else {