diff --git a/LICENSE b/LICENSE index 7996a17..3c1acdd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Maslov Ivan +Copyright (c) 2015-2017 Maslov Ivan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 60cee4a..4984ba4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -DuelJS v1.2.6 +DuelJS v1.2.7 ====== [![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat-square)](http://dueljs.readthedocs.org/) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/studentIvan/dueljs/master/LICENSE) [![Bower](https://img.shields.io/bower/v/duel.svg?style=flat-square)](http://bower.io/search/?q=duel) [![](https://img.shields.io/github/issues-raw/studentIvan/dueljs.svg?style=flat-square)](https://github.com/studentIvan/dueljs/issues/) [![GitHub stars](https://img.shields.io/github/stars/studentIvan/dueljs.svg?style=flat-square)](https://github.com/studentIvan/dueljs/stargazers) @@ -8,6 +8,9 @@ See a brief look on [the homepage](http://dueljs.studentivan.ru) Documentation available on http://dueljs.readthedocs.org/ +######New in 1.2.7: +* Fixed [#13](https://github.com/studentIvan/dueljs/issues/13): webpack import + ######New in 1.2.6: * Fixed [#11](https://github.com/studentIvan/dueljs/issues/11): localstorage issue for private browsing (thanks to Stéphane Bachelier ) * Library added to npm as dueljs (thanks to Denis Lukov ) @@ -73,4 +76,26 @@ duel.useStorageEvent = false; // auto false in IE Internet Explorer does incorrect. So it using force `useStorageEvent = false` by default. ######How it works with Internet Explorer without storage event? -Don't worry. It using setInterval javascript checking. \ No newline at end of file +Don't worry. It using setInterval javascript checking. + +######Testing suite +1. NodeJS version 6.7.0 +2. PhantomJS version 2.1.1 +3. Chai version 3.5.0 +4. Mocha version 3.1.0 +5. Mocha-PhantomJS custom fork of 4.1.0 + +In Mac OS Sierra you want to use phantomjs from brew (brew install phantomjs) and check to link it: + +``` +$ which phantomjs +/usr/local/bin/phantomjs +``` + +And also you can create this link by yourself: + +``` +ln -s /usr/local/Cellar/phantomjs/2.1.1/bin/phantomjs /usr/local/bin/phantomjs +``` + +The reason I temporary changed original repo of mocha-phantomjs to git+https://github.com/studentIvan/mocha-phantomjs.git#master is cause mocha-phantomjs doesn't support the second phantomjs right now. \ No newline at end of file diff --git a/package.json b/package.json index a96ea33..6c51de1 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,18 @@ { "name": "dueljs", - "version": "1.2.6", + "version": "1.2.7", "description": "DuelJS - JavaScript HTML5 Master/Slave Browser Tabs Helper", "main": "public/lib/duel.js", "devDependencies": { - "chai": "^1.10.0", - "mocha": "^2.1.0", - "mocha-phantomjs": "^3.5.3", - "phantomjs": "^1.9.13", - "http-server": "*", + "chai": "3.5.0", + "mocha": "3.1.0", + "mocha-phantomjs": "git+https://github.com/studentIvan/mocha-phantomjs.git#master", "uglifyjs": "*" }, "scripts": { - "pretest": "npm install && mocha-phantomjs test/mocha.test.html && mocha-phantomjs test/mocha.min.test.html", + "pretest": "npm install && node_modules/.bin/mocha-phantomjs test/mocha.test.umd.html && node_modules/.bin/mocha-phantomjs test/mocha.test.html && node_modules/.bin/mocha-phantomjs test/mocha.min.test.html", "test": "phantomjs test/phantom.script.js", - "start": "npm install && node_modules/.bin/http-server", + "start": "npm install && http-server -p 8089", "min": "npm install && node_modules/.bin/uglifyjs --compress --bare-returns --keep-fnames --source-map=public/lib/duel.min.js.map --source-map-url=duel.min.js.map --output=public/lib/duel.min.js --mangle -- public/lib/duel.js" }, "repository": { diff --git a/public/lib/duel.js b/public/lib/duel.js index d932e97..1600df7 100644 --- a/public/lib/duel.js +++ b/public/lib/duel.js @@ -1,5 +1,5 @@ /*! - * DuelJS JavaScript Library v1.2.5 + * DuelJS JavaScript Library v1.2.7 * https://github.com/studentIvan/dueljs * http://dueljs.readthedocs.org/en/latest/ * @@ -24,7 +24,7 @@ // Browser globals root.duel = factory(root); } -}(this, function (window) { +}(typeof window !== "undefined" ? window : this, function (window) { var duel = {}; /** diff --git a/public/lib/duel.min.js b/public/lib/duel.min.js index 4dda289..fe0ac67 100644 --- a/public/lib/duel.min.js +++ b/public/lib/duel.min.js @@ -1,2 +1,2 @@ -!function(e,t){"use strict";"function"==typeof define&&define.amd?define(function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.duel=t(e)}(this,function(e){var t={};return t.useStorageEvent=!/trident|MSIE/i.test(navigator.userAgent),t.noWarnings=!0,t.isLocalStorageAvailable=function(){try{return"localStorage"in e&&null!==e.localStorage&&void 0!==e.localStorage}catch(t){return!1}},t.clone=function(e){var n;if(null==e||"object"!=typeof e)return e;if(e instanceof Object){n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t.clone(e[r]));return n}throw new Error("Unable to copy obj! Its type isn't supported.")},t.DuelAbstractChannel=function(){var e=function(){};return e.prototype.getName=function(){return this._name},e.prototype.setCurrentWindowAsMaster=function(){return!0},e.prototype.currentWindowIsMaster=function(){return!0},e.prototype.broadcast=function(e){this.currentWindowIsMaster()&&this.executeTrigger({name:e,args:Array.prototype.slice.call(arguments,1)})},e.prototype.emit=function(){this.broadcast.apply(this,arguments)},e.prototype.getItem=function(e){return e+=":dueljs:variable:"+this.getName(),this.__storage?"object"==typeof angular?angular.fromJson(this.__storage.getItem(e)):JSON.parse(this.__storage.getItem(e),!0):null},e.prototype.setItem=function(e,t){this.__storage&&(e+=":dueljs:variable:"+this.getName(),this.__storage.setItem(e,"object"==typeof angular?angular.toJson(t):JSON.stringify(t)))},e.prototype.removeItem=function(e){this.__storage&&(e+=":dueljs:variable:"+this.getName(),this.__storage.removeItem(e))},e.prototype.executeTrigger=function(e,n){if(n=n||!1,!(e instanceof Object))throw"triggerDetails should be an Object";if(!this.currentWindowIsMaster()||n)try{this._triggers[e.name]instanceof Array?(this._triggers[e.name][0].apply(this,e.args),delete this._triggers[e.name]):this._triggers[e.name].apply(this,e.args)}catch(r){t.noWarnings||("object"==typeof angular?console.warn("DuelJS caught exception, maybe you didn't know that the functions inside the dueljs events use a their own scopes",r):console.warn("DuelJS caught exception",r))}},e.prototype.on=function(e,t){this._triggers||(this._triggers={}),this._triggers[e]=t},e.prototype.once=function(e,t){this.on(e,[t])},e.prototype.off=function(e){try{delete this._triggers[e]}catch(t){}},e}(),t._generateWindowID=function(){return this._windowID=+Math.random().toString().split(".")[1],this._windowID},t.getWindowID=function(){return this._windowID?this._windowID:this._generateWindowID()},t.DuelLocalStorageChannel=function(t){this._name=t,this.__storage=e.localStorage,this.setCurrentWindowAsMaster()},t.DuelLocalStorageChannel.prototype=t.clone(t.DuelAbstractChannel.prototype),t.DuelLocalStorageChannel.prototype.setCurrentWindowAsMaster=function(){var e,n,r,a,o=t.getWindowID(),i="dueljs_channel_"+this.getName();if(r=this.__storage.getItem(i)){for(r=JSON.parse(r),a=-1,e=0,n=r.length;n>e;e++)r[e].master=!1,r[e].id===o&&(a=e);-1===a?r.push({id:o,master:!0}):r[a].master=!0,this.__storage.setItem(i,JSON.stringify(r))}else this.__storage.setItem(i,JSON.stringify([{id:o,master:!0}]));return!0},t.DuelLocalStorageChannel.prototype.currentWindowIsMaster=function(){var e,n,r,a,o=t.getWindowID(),i="dueljs_channel_"+this.getName();if(r=this.__storage.getItem(i)){for(r=JSON.parse(r),a=-1,e=0,n=r.length;n>e;e++)if(r[e].id===o){a=e;break}return-1===a?!1:r[a].master}return!1},t.DuelLocalStorageChannel.prototype.broadcast=function(e){this.currentWindowIsMaster()&&(this.__storage.setItem("dueljs_trigger",JSON.stringify({channelName:this.getName(),triggerDetails:{name:e,args:Array.prototype.slice.call(arguments,1)}})),this.__storage.setItem("dueljs_trigger_event_key",+Math.random().toString().split(".")[1]))},t.DuelFakeChannel=function(e){this._name=e,t.noWarnings||console.error("DuelJS warning: instanceof DuelFakeChannel was created, check the localStorage support in your browser")},t.DuelFakeChannel.prototype=t.clone(t.DuelAbstractChannel.prototype),t.activeChannels=[],t.channel=function(e){for(var n in t.activeChannels)if(t.activeChannels.hasOwnProperty(n)&&t.activeChannels[n].getName()==e)return t.activeChannels[n];var r=this.isLocalStorageAvailable()?new this.DuelLocalStorageChannel(e):new this.DuelFakeChannel(e);return t.activeChannels.push(r),r},t.makeCurrentWindowMaster=function(){for(var e=t.activeChannels.length-1;e>=0;e--)try{t.activeChannels[e].setCurrentWindowAsMaster()}catch(n){}},e.onfocus=function(){t.makeCurrentWindowMaster()},e.isMaster=function(){return t.activeChannels.length?t.activeChannels[0].currentWindowIsMaster():!0},t.addEvent=function(){return document.addEventListener?function(t,n,r){if(t&&t.nodeName||t===e)t.addEventListener(n,r,!1);else if(t&&t.length)for(var a=0;a=0;r--)try{t.activeChannels[r].getName()==n.channelName&&t.activeChannels[r].executeTrigger(n.triggerDetails)}catch(a){}},t.isLocalStorageAvailable()&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.useStorageEvent?t.addEvent(e,"storage",function(n){var r=n||r||e.event;"dueljs_trigger_event_key"==r.key&&r.newValue!=t.storageOldTriggerValue&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.storageEvent({key:"dueljs_trigger",newValue:e.localStorage.getItem("dueljs_trigger")}))}):setInterval(function(){e.localStorage.getItem("dueljs_trigger_event_key")!=t.storageOldTriggerValue&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.storageEvent({key:"dueljs_trigger",newValue:e.localStorage.getItem("dueljs_trigger")}))},100),t.addEvent(e,"unload",function(){var n,r,a,o,i,s,l=t.getWindowID();for(a=t.activeChannels.length-1;a>=0;a--)try{if(i="dueljs_channel_"+t.activeChannels[a].getName(),n=e.localStorage.getItem(i))for(n=JSON.parse(n),s=-1,o=0,r=n.length;r>o;o++)if(n[o].id===l){n[o].master&&(n[o].master=!1,n[0].master=!0),n.splice(o,1),e.localStorage.setItem(i,JSON.stringify(n));break}}catch(g){}})),t}); +!function(e,t){"use strict";"function"==typeof define&&define.amd?define(function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.duel=t(e)}("undefined"!=typeof window?window:this,function(e){var t={};return t.useStorageEvent=!/trident|MSIE/i.test(navigator.userAgent),t.noWarnings=!0,t.isLocalStorageAvailable=function(){try{var e="undefined"!=typeof localStorage&&"setItem"in localStorage&&localStorage.setItem;if(!e)return!1;var t=new Date;return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(n){return!1}},t.clone=function(e){var n;if(null==e||"object"!=typeof e)return e;if(e instanceof Object){n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t.clone(e[r]));return n}throw new Error("Unable to copy obj! Its type isn't supported.")},t.DuelAbstractChannel=function(){var e=function(){};return e.prototype.getName=function(){return this._name},e.prototype.setCurrentWindowAsMaster=function(){return!0},e.prototype.currentWindowIsMaster=function(){return!0},e.prototype.broadcast=function(e){this.currentWindowIsMaster()&&this.executeTrigger({name:e,args:Array.prototype.slice.call(arguments,1)})},e.prototype.emit=function(){this.broadcast.apply(this,arguments)},e.prototype.getItem=function(e){return e+=":dueljs:variable:"+this.getName(),this.__storage?"object"==typeof angular?angular.fromJson(this.__storage.getItem(e)):JSON.parse(this.__storage.getItem(e),!0):null},e.prototype.setItem=function(e,t){this.__storage&&(e+=":dueljs:variable:"+this.getName(),this.__storage.setItem(e,"object"==typeof angular?angular.toJson(t):JSON.stringify(t)))},e.prototype.removeItem=function(e){this.__storage&&(e+=":dueljs:variable:"+this.getName(),this.__storage.removeItem(e))},e.prototype.executeTrigger=function(e,n){if(n=n||!1,!(e instanceof Object))throw"triggerDetails should be an Object";if(!this.currentWindowIsMaster()||n)try{this._triggers[e.name]instanceof Array?(this._triggers[e.name][0].apply(this,e.args),delete this._triggers[e.name]):this._triggers[e.name].apply(this,e.args)}catch(r){t.noWarnings||("object"==typeof angular?console.warn("DuelJS caught exception, maybe you didn't know that the functions inside the dueljs events use a their own scopes",r):console.warn("DuelJS caught exception",r))}},e.prototype.on=function(e,t){this._triggers||(this._triggers={}),this._triggers[e]=t},e.prototype.once=function(e,t){this.on(e,[t])},e.prototype.off=function(e){try{delete this._triggers[e]}catch(t){}},e}(),t._generateWindowID=function(){return this._windowID=+Math.random().toString().split(".")[1],this._windowID},t.getWindowID=function(){return this._windowID?this._windowID:this._generateWindowID()},t.DuelLocalStorageChannel=function(t){this._name=t,this.__storage=e.localStorage,this.setCurrentWindowAsMaster()},t.DuelLocalStorageChannel.prototype=t.clone(t.DuelAbstractChannel.prototype),t.DuelLocalStorageChannel.prototype.setCurrentWindowAsMaster=function(){var e,n,r,a,o=t.getWindowID(),i="dueljs_channel_"+this.getName();if(r=this.__storage.getItem(i)){for(r=JSON.parse(r),a=-1,e=0,n=r.length;n>e;e++)r[e].master=!1,r[e].id===o&&(a=e);-1===a?r.push({id:o,master:!0}):r[a].master=!0,this.__storage.setItem(i,JSON.stringify(r))}else this.__storage.setItem(i,JSON.stringify([{id:o,master:!0}]));return!0},t.DuelLocalStorageChannel.prototype.currentWindowIsMaster=function(){var e,n,r,a,o=t.getWindowID(),i="dueljs_channel_"+this.getName();if(r=this.__storage.getItem(i)){for(r=JSON.parse(r),a=-1,e=0,n=r.length;n>e;e++)if(r[e].id===o){a=e;break}return-1===a?!1:r[a].master}return!1},t.DuelLocalStorageChannel.prototype.broadcast=function(e){this.currentWindowIsMaster()&&(this.__storage.setItem("dueljs_trigger",JSON.stringify({channelName:this.getName(),triggerDetails:{name:e,args:Array.prototype.slice.call(arguments,1)}})),this.__storage.setItem("dueljs_trigger_event_key",+Math.random().toString().split(".")[1]))},t.DuelFakeChannel=function(e){this._name=e,t.noWarnings||console.error("DuelJS warning: instanceof DuelFakeChannel was created, check the localStorage support in your browser")},t.DuelFakeChannel.prototype=t.clone(t.DuelAbstractChannel.prototype),t.activeChannels=[],t.channel=function(e){for(var n in t.activeChannels)if(t.activeChannels.hasOwnProperty(n)&&t.activeChannels[n].getName()==e)return t.activeChannels[n];var r=this.isLocalStorageAvailable()?new this.DuelLocalStorageChannel(e):new this.DuelFakeChannel(e);return t.activeChannels.push(r),r},t.makeCurrentWindowMaster=function(){for(var e=t.activeChannels.length-1;e>=0;e--)try{t.activeChannels[e].setCurrentWindowAsMaster()}catch(n){}},e.onfocus=function(){t.makeCurrentWindowMaster()},e.isMaster=function(){return t.activeChannels.length?t.activeChannels[0].currentWindowIsMaster():!0},t.addEvent=function(){return document.addEventListener?function(t,n,r){if(t&&t.nodeName||t===e)t.addEventListener(n,r,!1);else if(t&&t.length)for(var a=0;a=0;r--)try{t.activeChannels[r].getName()==n.channelName&&t.activeChannels[r].executeTrigger(n.triggerDetails)}catch(a){}},t.isLocalStorageAvailable()&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.useStorageEvent?t.addEvent(e,"storage",function(n){var r=n||r||e.event;"dueljs_trigger_event_key"==r.key&&r.newValue!=t.storageOldTriggerValue&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.storageEvent({key:"dueljs_trigger",newValue:e.localStorage.getItem("dueljs_trigger")}))}):setInterval(function(){e.localStorage.getItem("dueljs_trigger_event_key")!=t.storageOldTriggerValue&&(t.storageOldTriggerValue=e.localStorage.getItem("dueljs_trigger_event_key"),t.storageEvent({key:"dueljs_trigger",newValue:e.localStorage.getItem("dueljs_trigger")}))},100),t.addEvent(e,"unload",function(){var n,r,a,o,i,s,l=t.getWindowID();for(a=t.activeChannels.length-1;a>=0;a--)try{if(i="dueljs_channel_"+t.activeChannels[a].getName(),n=e.localStorage.getItem(i))for(n=JSON.parse(n),s=-1,o=0,r=n.length;r>o;o++)if(n[o].id===l){n[o].master&&(n[o].master=!1,n[0].master=!0),n.splice(o,1),e.localStorage.setItem(i,JSON.stringify(n));break}}catch(g){}})),t}); //# sourceMappingURL=duel.min.js.map \ No newline at end of file diff --git a/public/lib/duel.min.js.map b/public/lib/duel.min.js.map index a2ed444..f60a36e 100644 --- a/public/lib/duel.min.js.map +++ b/public/lib/duel.min.js.map @@ -1 +1 @@ -{"version":3,"file":"public/lib/duel.min.js","sources":["public/lib/duel.js"],"names":["root","factory","define","amd","exports","module","duel","this","window","useStorageEvent","test","navigator","userAgent","noWarnings","isLocalStorageAvailable","undefined","e","clone","obj","copy","Object","attr","hasOwnProperty","Error","DuelAbstractChannel","prototype","getName","_name","setCurrentWindowAsMaster","currentWindowIsMaster","broadcast","trigger","executeTrigger","name","args","Array","slice","call","arguments","emit","apply","getItem","varName","__storage","angular","fromJson","JSON","parse","setItem","value","toJson","stringify","removeItem","triggerDetails","force","_triggers","console","warn","on","callback","once","off","_generateWindowID","_windowID","Math","random","toString","split","getWindowID","DuelLocalStorageChannel","localStorage","i","len","ch","wIndex","wID","chName","length","master","id","push","channelName","DuelFakeChannel","error","activeChannels","channel","chID","makeCurrentWindowMaster","onfocus","isMaster","addEvent","document","addEventListener","el","type","fn","nodeName","attachEvent","event","hidden","storageEvent","key","eventDetails","newValue","storageOldTriggerValue","setInterval","j","splice"],"mappings":"CASC,SAAUA,EAAMC,GACf,YAEsB,mBAAXC,SAAyBA,OAAOC,IAEzCD,OAAO,WAEL,MAAOD,GAAQD,KAEW,gBAAZI,SAGhBC,OAAOD,QAAUH,EAAQD,GAGzBA,EAAKM,KAAOL,EAAQD,IAEtBO,KAAM,SAAUC,GAChB,GAAIF,KAkfJ,OAzeAA,GAAKG,iBAAmB,gBAAgBC,KAAKC,UAAUC,WAOvDN,EAAKO,YAAa,EAMlBP,EAAKQ,wBAA0B,WAC7B,IACE,MAAO,gBAAkBN,IAAqC,OAA3BA,EAAqB,cAAyCO,SAA3BP,EAAqB,aAC3F,MAAOQ,GACP,OAAO,IASXV,EAAKW,MAAQ,SAAUC,GACrB,GAAIC,EAEJ,IAAI,MAAQD,GAAO,gBAAmBA,GAAK,MAAOA,EAElD,IAAIA,YAAeE,QAAQ,CACzBD,IACA,KAAK,GAAIE,KAAQH,GACXA,EAAII,eAAeD,KAAOF,EAAKE,GAAQf,EAAKW,MAAMC,EAAIG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S,GAEjBL,EAAGkC,OAAOD,EAAG,GACblG,EAAO8D,aAAatB,QAAQ4B,EAAQ9B,KAAKK,UAAUsB,GACnD,QAIN,MAAOzD,QAORV"} \ No newline at end of file +{"version":3,"file":"public/lib/duel.min.js","sources":["public/lib/duel.js"],"names":["root","factory","define","amd","exports","module","duel","window","this","useStorageEvent","test","navigator","userAgent","noWarnings","isLocalStorageAvailable","hasStorage","localStorage","setItem","uid","Date","removeItem","e","clone","obj","copy","Object","attr","hasOwnProperty","Error","DuelAbstractChannel","prototype","getName","_name","setCurrentWindowAsMaster","currentWindowIsMaster","broadcast","trigger","executeTrigger","name","args","Array","slice","call","arguments","emit","apply","getItem","varName","__storage","angular","fromJson","JSON","parse","value","toJson","stringify","triggerDetails","force","_triggers","console","warn","on","callback","once","off","_generateWindowID","_windowID","Math","random","toString","split","getWindowID","DuelLocalStorageChannel","i","len","ch","wIndex","wID","chName","length","master","id","push","channelName","DuelFakeChannel","error","activeChannels","channel","chID","makeCurrentWindowMaster","onfocus","isMaster","addEvent","document","addEventListener","el","type","fn","nodeName","attachEvent","event","hidden","storageEvent","key","eventDetails","newValue","storageOldTriggerValue","setInterval","j","splice"],"mappings":"CASC,SAAUA,EAAMC,GACf,YAEsB,mBAAXC,SAAyBA,OAAOC,IAEzCD,OAAO,WAEL,MAAOD,GAAQD,KAEW,gBAAZI,SAGhBC,OAAOD,QAAUH,EAAQD,GAGzBA,EAAKM,KAAOL,EAAQD,IAEJ,mBAAXO,QAAyBA,OAASC,KAAM,SAAUD,GACzD,GAAID,KA0fJ,OAjfAA,GAAKG,iBAAmB,gBAAgBC,KAAKC,UAAUC,WAOvDN,EAAKO,YAAa,EAMlBP,EAAKQ,wBAA0B,WAC7B,IACE,GAAIC,GAAqC,mBAAjBC,eAAiC,WAAaA,eAAiBA,aAAaC,OACpG,KAAKF,EACH,OAAO,CAGT,IAAIG,GAAM,GAAIC,KAGd,OAFAH,cAAaC,QAAQC,EAAKA,GAC1BF,aAAaI,WAAW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S,aAAa8B,QAAQgC,GACnC,IAAKH,EAAKxB,KAAKC,MAAMuB,GAAKC,EAAS,GAAIgC,EAAI,EAAGlC,EAAMC,EAAGI,OAAYL,EAAJkC,EAASA,IACtE,GAAIjC,EAAGiC,GAAG3B,KAAOJ,EAAK,CAChBF,EAAGiC,GAAG5B,SACRL,EAAGiC,GAAG5B,QAAS,EACfL,EAAG,GAAGK,QAAS,GAEjBL,EAAGkC,OAAOD,EAAG,GACbrG,EAAOS,aAAaC,QAAQ6D,EAAQ3B,KAAKI,UAAUoB,GACnD,QAIN,MAAOtD,QAORf"} \ No newline at end of file diff --git a/test/mocha.test.umd.html b/test/mocha.test.umd.html new file mode 100644 index 0000000..499c1c3 --- /dev/null +++ b/test/mocha.test.umd.html @@ -0,0 +1,12 @@ + + + + + + + +
+ + + + \ No newline at end of file diff --git a/test/requirejs.main.js b/test/requirejs.main.js new file mode 100644 index 0000000..ee6f369 --- /dev/null +++ b/test/requirejs.main.js @@ -0,0 +1,57 @@ +define(function (require) { + var chai = require('../node_modules/chai/chai'); + var duel = require('../public/lib/duel'); + + mocha.ui('bdd'); + mocha.reporter('html'); + mocha.globals(['duel']); + + var expect = chai.expect; + + describe('DuelJS test case requirejs', function() { + describe('#initialization testing', function() { + + it('duel should be initialized', function() { + expect(duel).to.be.an.instanceof(Object); + }); + + it('duel integrity should be complete', function() { + expect(duel.clone).not.to.be.an('undefined'); + expect(duel.DuelAbstractChannel).not.to.be.an('undefined'); + expect(duel.getWindowID).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.getName).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.executeTrigger).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.on).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.once).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.off).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.emit).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.setCurrentWindowAsMaster).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.currentWindowIsMaster).not.to.be.an('undefined'); + expect(duel.DuelLocalStorageChannel.prototype.broadcast).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.getName).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.executeTrigger).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.on).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.once).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.off).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.emit).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.setCurrentWindowAsMaster).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.currentWindowIsMaster).not.to.be.an('undefined'); + expect(duel.DuelFakeChannel.prototype.broadcast).not.to.be.an('undefined'); + expect(duel.activeChannels).to.be.an('array'); + expect(duel.channel).not.to.be.an('undefined'); + expect(duel.makeCurrentWindowMaster).not.to.be.an('undefined'); + expect(window.isMaster).not.to.be.an('undefined'); + expect(duel.addEvent).not.to.be.an('undefined'); + expect(duel.storageEvent).not.to.be.an('undefined'); + }); + }); + }); + + if (window.mochaPhantomJS) { + mochaPhantomJS.run(); + } else { + mocha.run(); + } +});