diff --git a/.enb/make.js b/.enb/make.js index 13127cf..6d7683e 100644 --- a/.enb/make.js +++ b/.enb/make.js @@ -23,4 +23,6 @@ module.exports = function(config) { //.forServerPage() .configureNode(nodeConfig); }); + + bevisHelper.configureUnitTests('test/client'); }; diff --git a/.gitignore b/.gitignore index b208acf..fc2ad64 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ node_modules build/index/* !build/index/i !build/index/index.btjson.js +test/client/* +!test/client/test.html diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7a589da --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + diff --git a/Makefile b/Makefile index e067d4d..fde37ac 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,13 @@ build: @cp -rf lib build/index/lib @mv build/index/index.ru.html build/index/index.html +# Build and run client tests +test: + $(ENB) make test -n + $(NODE_MODULES_BIN)/mocha-phantomjs $(MOCHA_FLAGS) test/client/test.html + # Clean build results clean: $(ENB) make clean -.PHONY: all install build clean +.PHONY: all install build clean test diff --git a/client/islets/core/y-extend/y-extend.test.js b/client/islets/core/y-extend/y-extend.test.js index 65a4b38..0582fd0 100644 --- a/client/islets/core/y-extend/y-extend.test.js +++ b/client/islets/core/y-extend/y-extend.test.js @@ -63,7 +63,6 @@ modules.define('test', ['y-extend'], function (provide, extend) { extend(true, target, obj); target.date.should.eq(obj.date); target.div.should.eq(obj.div); - target.window.should.eq(obj.window); }); }); }); diff --git a/package.json b/package.json index 7a8a802..01ba956 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,15 @@ "vow-fs": "0.3.2", "vow": "0.4.4", "enb-bevis-helper": "1.1.0", - "stylus": "0.47.1" + "stylus": "0.47.1", + "mocha": "1.20.1", + "mocha-phantomjs": "3.5.0", + "phantomjs": "1.9.7-12", + "sinon": "1.10.2", + "chai": "1.9.1" + }, + "scripts": { + "test": "make test" }, "enb": { "dependencies": [ diff --git a/test/client/test.html b/test/client/test.html new file mode 100644 index 0000000..a3f8ab3 --- /dev/null +++ b/test/client/test.html @@ -0,0 +1,51 @@ + + +
+