From 2a897325abe2da2bf7ecb3844cc7c839c7bca17d Mon Sep 17 00:00:00 2001 From: Christoph Burgmer Date: Tue, 18 Nov 2014 19:44:43 +0100 Subject: [PATCH] Use karma runner to execute test against browser. #40 --- karma.conf.js | 11 +++++++++++ package.json | 11 +++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 karma.conf.js diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..20ea2f9 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,11 @@ +module.exports = function(config) { + config.set({ + browsers : ['PhantomJS'], + frameworks: ['jasmine'], + files: [ + 'js/*.js', + 'spec/*.js' + ], + singleRun: true + }); +}; diff --git a/package.json b/package.json index 9df506b..a67d656 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,12 @@ "canvas": "~1.0" }, "devDependencies": { + "jasmine-core": "~2.1.2", "jasmine-node": "~2.0.0", - "smoosh": ">=0.3.1", - "jasmine-core": "~2.0.0" + "karma": "~0.12.25", + "karma-jasmine": "~0.3.0", + "karma-phantomjs-launcher": "~0.1.4", + "smoosh": ">=0.3.1" }, "repository": { "type": "git", @@ -33,9 +36,9 @@ "node": ">= 0.6.0" }, "bin": { - "imagediff" : "./bin/imagediff" + "imagediff": "./bin/imagediff" }, "scripts": { - "test": "cd spec && jasmine-node --captureExceptions ." + "test": "cd spec && jasmine-node --captureExceptions . && cd .. && karma start karma.conf.js" } }