A rig containing tasks used for running unit tests
- Install rigs package:
npm install rigs
- Install rig-unit-test:
npm install rig-unit-test
-
rig-unit-test__karma
: A task which runs Karma with the specific configuration (suitable for browser testing - frontend)-
properties:
karma
: Object, contains Karma configuration. More info on karma website
{ taskname: 'rig-unit-test__karma', dependency: [], karma: { basePath: './', frameworks: [ 'jasmine', 'browserify' ], preprocessors: { '/spec/unit/**/*.js': [ 'browserify' ] }, files: [ '/spec/unit/**/*.js' ], exclude: [], browserify: { debug: true, transform: [ 'browserify-ngannotate', require( 'browserify-istanbul' )( { ignore: [ '**/node_modules/**', '**/spec/**' ] } ) ] }, reporters: [ 'progress', 'coverage' ], coverageReporter: { reporters: [ { type: 'text' }, { type: 'text-summary' }, { type: 'cobertura', dir: './coverage/unit/' }, { type: 'html', dir: './coverage/unit/' } ] }, port: 9876, colors: true, autoWatch: true, browsers: [ 'PhantomJS' ], singleRun: true } }
-
-
rig-unit-test__mocha
: A task which runs Mocha with the specific configuration (suitable for nodejs testing - backend)-
properties:
src
: String or Array, refers to the source files for code coveragetests
: String or Array, refers to the source files of the unit testsistanbul
: Object, refers to istanbul configuration. See more at gulp-istanbulmocha
: Object, refers to mocha configuration. See more at gulp-mochareports
: Object, refers to istanbul reporting configuration.
{ taskname: 'rig-unit-test__mocha', dependency: [], src: './src/**/*.js', tests: './spec/**/*.js', istanbul: { includeUntested: true }, mocha: { reporter: 'nyan' }, reports: { dir: './coverage', reporters: [ 'lcov' ], reportOpts: { dir: './coverage' } } }
-