]> source.dussan.org Git - svg.js.git/commitdiff
added code coverage
authordotnetCarpenter <jon.ronnenberg@gmail.com>
Sat, 12 Nov 2016 23:20:28 +0000 (00:20 +0100)
committerdotnetCarpenter <jon.ronnenberg@gmail.com>
Sat, 12 Nov 2016 23:23:52 +0000 (00:23 +0100)
.config/karma.conf.js
.gitignore
.travis.yml
README.md
dist/svg.js
gulpfile.js
package.json

index ad256e21b88edd4e2da48ec2b22bfd354b3cd668..174fe131b454bb87cecffe17703ca3e4c7ec1781 100644 (file)
@@ -37,13 +37,27 @@ module.exports = function(config) {
 
     // preprocess matching files before serving them to the browser
     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
-    preprocessors: {},
+    preprocessors: {
+      'dist/svg.js': ['coverage']
+    },
 
 
     // test results reporter to use
     // possible values: 'dots', 'progress'
     // available reporters: https://npmjs.org/browse/keyword/karma-reporter
-    reporters: ['progress'],
+    reporters: ['progress', 'coverage'],
+
+
+    // configure the coverage reporter
+    coverageReporter: {
+      // Specify a reporter type.
+      type: 'lcov',
+      dir: 'coverage/',
+      subdir: function(browser) {
+        // normalization process to keep a consistent browser name accross different OS
+        return browser.toLowerCase().split(/[ /-]/)[0]; // output the results into: './coverage/firefox/'
+      }
+    },
 
 
     // web server port
index e27f6184c494e2bdc95363d5baf220a9c9687ad5..57a3831568fab71ff2e3d8755705407911fccc60 100644 (file)
@@ -8,4 +8,5 @@ obsolete/
 test/
 src/index.js
 node_modules/
-.vscode/
\ No newline at end of file
+.vscode/
+coverage/
index 5ea821fc8768353d96e804a819e4d7d2fcb99063..a66a42804e8fbf8eab28ab27b43e168d626077d8 100644 (file)
@@ -4,6 +4,7 @@ node_js:
 script:
     - npm run build
     - npm test
+    - cat coverage/firefox/lcov.info | node_modules/.bin/coveralls
 #sudo: required
 #dist: trusty
 addons:
index 6d69d1bb5bd9b41ad0503cbd1fcfcbca30641509..9d1dd6a2bc512b1af6424410aafa081e94783a11 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # SVG.js
 
 [![Build Status](https://travis-ci.org/svgdotjs/svg.js.svg?branch=master)](https://travis-ci.org/svgdotjs/svg.js)
+[![Coverage Status](https://coveralls.io/repos/github/svgdotjs/svg.js/badge.svg?branch=master)](https://coveralls.io/github/svgdotjs/svg.js?branch=master)
 
 A lightweight library for manipulating and animating SVG.
 
index ad8abdac6d97cae1a0d99300d2efbc863c4a43eb..54ba2a4b22c01b3eaa45679eb8afd766bc328ef8 100644 (file)
@@ -6,7 +6,7 @@
 * @copyright Wout Fierens <wout@mick-wout.com.com>
 * @license MIT
 *
-* BUILT: Sat Nov 12 2016 22:04:58 GMT+0100 (CET)
+* BUILT: Sun Nov 13 2016 00:23:29 GMT+0100 (CET)
 */;
 (function(root, factory) {
   if (typeof define === 'function' && define.amd) {
index d02081f3d21922223a60d0264f610ab0bab9bfbc..9d7c4de6ad7f5161944aadc27750dda16f731e78 100644 (file)
@@ -100,7 +100,7 @@ gulp.task('unify', ['clean'], function() {
     .pipe(wrapUmd({ src: 'src/umd.js'}))\r
     .pipe(header(headerLong, { pkg: pkg }))\r
     .pipe(trim({ leading: false }))\r
-    .pipe(chmod(644))\r
+    .pipe(chmod(0o644))\r
     .pipe(gulp.dest('dist'))\r
     .pipe(size({ showFiles: true, title: 'Full' }))\r
 })\r
@@ -116,7 +116,7 @@ gulp.task('minify', ['unify'], function() {
     .pipe(rename({ suffix:'.min' }))\r
     .pipe(size({ showFiles: true, title: 'Minified' }))\r
     .pipe(header(headerShort, { pkg: pkg }))\r
-    .pipe(chmod(644))\r
+    .pipe(chmod(0o644))\r
     .pipe(gulp.dest('dist'))\r
     .pipe(size({ showFiles: true, gzip: true, title: 'Gzipped' }))\r
 })\r
index a995821c245eac43018167a61824ae9ae8f5d57b..b983c792e0cf16d276466aea0e74f586290bf5d0 100644 (file)
     "docs": "gulp docs"
   },
   "devDependencies": {
+    "coveralls": "^2.11.15",
     "del": "^2.2.0",
     "gulp": "^3.8.6",
-    "gulp-chmod": "^1.2.0",
+    "gulp-chmod": "^2.0.0",
     "gulp-cli": "^1.2.2",
     "gulp-concat": "^2.3.3",
     "gulp-header": "^1.0.5",
@@ -72,8 +73,9 @@
     "gulp-wrap": "^0.13.0",
     "jasmine-core": "^2.5.2",
     "karma": "^1.3.0",
+    "karma-coverage": "^1.1.1",
     "karma-firefox-launcher": "^1.0.0",
     "karma-jasmine": "^1.0.2",
-    "request": "^2.75.0"
+    "request": "^2.78.0"
   }
 }