diff --git a/.gitignore b/.gitignore index d9c525c97..97fb12953 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,8 @@ node_modules components docs/doctrees/environment.pickle tags -test-reports +stamp-npm +stamp-bower # OSX .DS_Store diff --git a/Makefile b/Makefile index cc159d740..ff8ba5e41 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ PAPER = BUILDDIR = ./docs BOWER ?= node_modules/.bin/bower +PHANTOMJS ?= node_modules/.bin/phantomjs # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -51,12 +52,36 @@ release: sed -i "s/(Unreleased)/(`date +%Y-%m-%d`)/" docs/CHANGES.rst grunt minify -dev: + +######################################################################## +## Install dependencies + +stamp-npm: package.json + npm install + touch stamp-npm + +stamp-bower: stamp-npm bower.json + $(BOWER) install + touch stamp-bower + +clean:: + rm -f stamp-npm stamp-bower + rm -rf node_modules components + -rm -rf $(BUILDDIR)/* + +dev: clean npm install ${BOWER} update; -clean: - -rm -rf $(BUILDDIR)/* + +######################################################################## +## Tests + +check:: stamp-npm + $(PHANTOMJS) node_modules/phantom-jasmine/lib/run_jasmine_test.coffee tests.html + +######################################################################## +## Documentation html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/package.json b/package.json index dcb04c967..cb7423452 100755 --- a/package.json +++ b/package.json @@ -30,9 +30,9 @@ "grunt-cli": "~0.1.9", "grunt": "~0.4.1", "grunt-contrib-jshint": "~0.6.0", - "phantomjs": "~1.9.1-0", - "jasmine-reporters": "~0.2.1", - "bower": "~1.0.0", + "phantom-jasmine": "0.1.8", + "phantomjs": "~1.9.7-1", + "bower": "latest", "grunt-contrib-requirejs": "~0.4.1", "grunt-contrib-cssmin": "~0.6.1" }, diff --git a/tests_main.js b/tests_main.js index a9f812ed2..4229a14c9 100644 --- a/tests_main.js +++ b/tests_main.js @@ -3,21 +3,11 @@ config.paths.mock = "tests/mock"; config.paths.utils = "tests/utils"; config.paths.jasmine = "components/jasmine/lib/jasmine-core/jasmine"; config.paths["jasmine-html"] = "components/jasmine/lib/jasmine-core/jasmine-html"; -config.paths["jasmine-console-reporter"] = "node_modules/jasmine-reporters/src/jasmine.console_reporter"; -config.paths["jasmine-junit-reporter"] = "node_modules/jasmine-reporters/src/jasmine.junit_reporter"; - +config.paths["console-runner"] = "node_modules/phantom-jasmine/lib/console-runner"; config.shim['jasmine-html'] = { deps: ['jasmine'], exports: 'jasmine' }; -config.shim['jasmine-console-reporter'] = { - deps: ['jasmine-html'], - exports: 'jasmine' -}; -config.shim['jasmine-junit-reporter'] = { - deps: ['jasmine-html'], - exports: 'jasmine' -}; require.config(config); // Polyfill 'bind' which is not available in phantomjs < 2.0 @@ -27,8 +17,8 @@ if (!Function.prototype.bind) { // closest thing possible to the ECMAScript 5 internal IsCallable function throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, @@ -47,6 +37,7 @@ require([ "jasmine-html" ], function($, converse, mock, jasmine) { // Set up converse.js + $.fx.off = true; window.converse_api = converse; window.localStorage.clear(); converse.initialize({ @@ -64,12 +55,11 @@ require([ var i; for (i=0, len=buf.length; i