Skip to content

Commit

Permalink
Add karma unit test and mocha to project with sample test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Jul 28, 2016
1 parent b128812 commit 0a053d4
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
62 changes: 62 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Karma configuration
// Generated on Thu Jul 28 2016 15:38:32 GMT-0700 (PDT)

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: ['mocha'],


// list of files / patterns to load in the browser
files: [
'src/**/*test.js'
],


// list of files to exclude
exclude: [
],

// 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 addnd 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: false,


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


// 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: Infinity
})
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"private": true,
"scripts": {
"start": "webpack --watch",
"test": "karma start",
"postinstall": "bower install && typings install && webpack && webpack --config webpack.vendor.config.js"
},
"devDependencies": {
"angular": "1.5.7",
"angular": "~1.5.7",
"angular-animate": "^1.5.5",
"angular-bootstrap": "^0.12.2",
"angular-ui-select": "^0.12.100",
Expand All @@ -25,10 +26,14 @@
"html-webpack-plugin": "^2.15.0",
"imports-loader": "^0.6.5",
"jquery": "3.0.0",
"karma": "1.1.2",
"karma-chrome-launcher": "1.0.1",
"karma-mocha": "1.1.1",
"less": "2.7.1",
"less-loader": "^2.2.3",
"lodash": "4.13.1",
"minimist": "1.2.0",
"mocha": "2.5.3",
"ng-annotate-webpack-plugin": "0.1.3",
"node-sass": "^3.4.2",
"patternfly": "^3.3.1",
Expand Down
5 changes: 5 additions & 0 deletions src/components/controller.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('sample test', () => {
it('passing test',() => {

})
})

0 comments on commit 0a053d4

Please sign in to comment.