From 981ce24558f8a6af9478c0c309e31c7272d933dd Mon Sep 17 00:00:00 2001 From: dotnetCarpenter Date: Sun, 13 Nov 2016 11:21:50 +0100 Subject: [PATCH] added `npm run test:quick` which aim at being fast rather than correct - great for git hooks --- .config/karma.quick.js | 82 ++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 1 - CHANGELOG.md | 3 +- package.json | 2 ++ 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 .config/karma.quick.js diff --git a/.config/karma.quick.js b/.config/karma.quick.js new file mode 100644 index 0000000..4574707 --- /dev/null +++ b/.config/karma.quick.js @@ -0,0 +1,82 @@ +// Karma configuration +// Generated on Tue Oct 04 2016 13:53:46 GMT+0200 (CEST) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '../', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + '.config/pretest.js', + { + pattern: 'spec/fixture.css', + included: false, + served: true + }, + { + pattern: 'spec/fixture.svg', + included: false, + served: true + }, + 'dist/svg.js', + 'spec/spec/**/*.js' + ], + + + // list of files to exclude + exclude: [], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: {}, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // configure the coverage reporter + coverageReporter: {}, + + + // web server port + port: 9875, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_ERROR, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1 + }) +} diff --git a/.travis.yml b/.travis.yml index a66a428..ee9f3cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,4 +16,3 @@ before_install: cache: directories: - node_modules - diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a4ccba..fe7e2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,9 +15,10 @@ - fixed an error in `SVG.FX.step`, if custom properties is added to `Array.prototype` (#549) - updated dev dependencies; request and gulp-chmod - `npm run build` now requires nodejs 4.x - added code coverage https://coveralls.io/github/svgdotjs/svg.js +- added `npm run test:quick` which aim at being fast rather than correct - great for git hooks # 2.3.6 (21/10/2016) -- fixed leading and trailing space in SVG.PointArray would return NaN for some points (695f26a) (#527) +- fixed leading and trailing space in SVG.PointArray would return NaN for some points (695f26a) (#529) - make SVG.FX.loop modify the last situation instead of the current one (#532) - fixed test of `SVG.FX.afterAll` (#534) - fixed `SVG.FX.speed()` (#536) diff --git a/package.json b/package.json index b983c79..a86408d 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "scripts": { "build": "gulp", "test": "karma start .config/karma.conf.js --single-run", + "test:quick": "karma start .config/karma.quick.js", "docs": "gulp docs" }, "devDependencies": { @@ -76,6 +77,7 @@ "karma-coverage": "^1.1.1", "karma-firefox-launcher": "^1.0.0", "karma-jasmine": "^1.0.2", + "karma-phantomjs-launcher": "^1.0.2", "request": "^2.78.0" } } -- 2.39.5