Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
test: add karma-jasmine unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Jan 3, 2020
1 parent 4219f41 commit 69b5718
Show file tree
Hide file tree
Showing 5 changed files with 653 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
extends:
- airbnb-base

plugins:
- angular

rules:
import/no-extraneous-dependencies: off
no-console: off
Expand All @@ -10,3 +13,8 @@ rules:

globals:
angular: true

env:
node: true
jasmine: true
angular/mocks: true
67 changes: 67 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Karma configuration

module.exports = (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: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/@uirouter/angularjs/release/angular-ui-router.js',
'dist/ui-router-breadcrumbs.js',
'tests/**/*.spec.js',
],

// list of files / patterns 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'],

// web server port
port: 9876,

// 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_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,

// client options
client: {
// options for karma-jasmine
jasmine: {
random: false,
},
},
});
};
Loading

0 comments on commit 69b5718

Please sign in to comment.