diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed9f9cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 88050c4..85f070f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,7 @@ before_install: before_script: - npm install bower karma-cli -g - bower install + +script: npm run travis + +after_success: NODE_ENV=test cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage \ No newline at end of file diff --git a/README.md b/README.md index 2ecdde2..1d76648 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/pocesar/angular-errorlookup.svg?branch=master)](https://travis-ci.org/pocesar/angular-errorlookup?branch=master) +[![Build Status](https://travis-ci.org/pocesar/angular-errorlookup.svg?branch=master)](https://travis-ci.org/pocesar/angular-errorlookup?branch=master) [![Coverage Status](https://coveralls.io/repos/pocesar/angular-errorlookup/badge.svg?branch=master&service=github)](https://coveralls.io/github/pocesar/angular-errorlookup?branch=master) AngularJS ErrorLookup =================== diff --git a/bower.json b/bower.json index 3d8eaad..7405cee 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,13 @@ { "name": "angular-errorlookup", - "version": "0.2.0", + "version": "0.2.1", "description": "Because AngularJS general error messages still suck. ngMessages can kiss my ass.", "main": "./angular-lookup.js", "ignore": [ "**/.*", "node_modules", "bower_components", + "coverage", "test", "typings", "tsconfig.json", @@ -14,12 +15,12 @@ "tsd.json" ], "dependencies": { - "angular": ">=1.3||<1.5", + "angular": ">=1.3 <1.5", "lodash": "3.x", "jquery": "2.x" }, "devDependencies": { - "angular-mocks": ">=1.3||<1.5", + "angular-mocks": ">=1.3 <1.5", "chai":"*" } } diff --git a/package.json b/package.json index ef8f8db..600782e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name":"angular-errorlookup", - "version":"0.2.0", + "version":"0.2.1", "description": "Because AngularJS general error messages still suck. ngMessages can kiss my ass.", - "main": "./angular-lookup.js", + "main": "./angular-errorlookup.js", "license": "MIT", "repository":{ "type":"git", @@ -23,8 +23,10 @@ "form" ], "devDependencies":{ + "coveralls": "2.x", "karma":"0.13.x", "mocha": "*", + "karma-coverage": "0.x", "karma-firefox-launcher":"*", "karma-mocha":"*", "karma-spec-reporter":"*", @@ -32,6 +34,7 @@ "tsify": "0.x" }, "scripts":{ + "travis": "karma start ./test/karma.conf.js --single-run", "test": "karma start ./test/karma.conf.js", "build": "browserify angular-errorlookup.ts -p [ tsify ] > angular-errorlookup.js", "dorelease": "npm publish ." diff --git a/test/karma.conf.js b/test/karma.conf.js index 90df0c6..2711f75 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -11,14 +11,32 @@ module.exports = function (config){ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'angular-errorlookup.js', - 'test/test.js' + 'test/*.test.js' ], exclude : [], proxies : {}, - reporters : ['spec'], + reporters : ['spec','coverage'], + + preprocessors: { + 'angular-errorlookup.js': ['coverage'] + }, + + coverageReporter: { + reporters: [ + { type: 'html', dir:'coverage/' }, + { type: 'lcovonly', dir:'coverage/', subdir: '.', file: 'lcov.info' } + ] + }, + + client: { + captureConsole: true, + mocha: { + ui: 'bdd' + } + }, port : 9876, @@ -32,6 +50,6 @@ module.exports = function (config){ captureTimeout: 60000, - singleRun : true + singleRun : false }); }; diff --git a/test/test.js b/test/karma.test.js similarity index 100% rename from test/test.js rename to test/karma.test.js