Example to execute Karma Runner through Jenkiks CI and load xml report file.
Karma Runner and require.js + angular.js modular application with Gulp.js. Code and test specs together in same directory module. Vendors Libs, Application Source and Tests specs loaded by require.js on Karma Runner test page.
--
-
Must have Git installed
-
Must have node.js (at least v0.10+) installed with npm (Node Package Manager)
-
Must have bower node package installed globally
-
Must have Gulp.js node package installed globally.
sudo npm install -g gulp
-
Must have PhantomJS installed
/tools/script/setup.js
- will checkbower
,gulp
andphantomjs
, if not found, this script will install the needed global package and after setup environment, will install bower and npm dependencies.
Setup environment and start development : [
npm run setup
,gulp dev
]
$ npm start
Setup environment and run CI flow : [
npm run setup
,gulp ci
]
$ npm test
Based on [GitHub] soudev / gulp-steps - 04 - enhanced
- development mode
Project only
$ gulp project
Karma only
$ gulp specs
Project and Karma
$ gulp dev
--
check code coverage :
npm run coverage
that will call the following command
$ gulp coverage
- continuous integration (CI) mode
npm test
will call the following command
$ gulp ci
-
[GitHub] lodash / lodash - A JavaScript utility library delivering consistency, modularity, performance, & extras.
-
[GitHub] BrowserSync / browser-sync - Keep multiple browsers & devices in sync when building websites
-
[GitHub] bcoe / yargs - yargs the modern, pirate-themed successor to optimist
-
[GitHub] sindresorhus / del - Delete files/folders using globs
-
[GitHub] jrburke / r.js - Runs RequireJS in Node and Rhino, and used to run the RequireJS optimizer
-
[GitHub] OverZealous / lazypipe - Lazily create a pipeline out of reusable components. Useful for gulp.
-
[GitHub] OverZealous / run-sequence - Run a series of dependent gulp tasks in order
-
[GitHub] sindresorhus / jshint-stylish - Stylish reporter for JSHint
-
[GitHub] jackfranklin / gulp-load-plugins - Automatically load in gulp plugins
-
-
plugins
-
[GitHub] gulpjs / gulp-util - Utilities for gulp plugins
-
[GitHub] wearefractal / gulp-cached - A simple in-memory file cache for gulp
-
[GitHub] spalger / gulp-jshint - JSHint plugin for gulp
-
-
-
[GitHub] jasmine / jasmine - DOM-less simple JavaScript testing framework
-
-
[GitHub] karma-runner / karma - Spectacular Test Runner for JavaScript
-
[GitHub] karma-runner / karma-chrome-launcher - A Karma plugin. Launcher for Chrome and Chrome Canary.
-
[GitHub] karma-runner / karma-firefox-launcher - A Karma plugin. Launcher for Firefox.
-
[GitHub] karma-runner / karma-phantomjs-launcher - A Karma plugin. Launcher for PhantomJS.
-
[GitHub] karma-runner / karma-jasmine - A Karma plugin - adapter for Jasmine testing framework.
-
[GitHub] karma-runner / karma-ng-html2js-preprocessor - A Karma plugin. Compile AngularJS 1.x templates to JavaScript on the fly.
-
[GitHub] karma-runner / karma-coverage - A Karma plugin. Generate code coverage.
-
[GitHub] taras42 / karma-jasmine-html-reporter - A Karma plugin. Dynamically displays tests results at debug.html page
-
[GitHub] karma-runner / karma-junit-reporter - A Karma plugin. Report results in junit xml format.
-
[GitHub] karma-runner / karma-requirejs - A Karma plugin. Adapter for RequireJS framework.
-
-
[GitHub] eirslett / frontend-maven-plugin - A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
- All my code is licensed under the MIT License.