Setup unit tests

This commit is contained in:
Kevin Dietrich 2016-02-19 17:23:22 +01:00
parent 0202fa9257
commit b9b52603e8
2 changed files with 80 additions and 1 deletions

73
karma.conf.js Normal file
View file

@ -0,0 +1,73 @@
// Karma configuration
// Generated on Thu Feb 18 2016 22:00:23 GMT+0100 (CET)
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: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/jquery-ui/jquery-ui.min.js',
'bower_components/lodash/dist/lodash.min.js',
'src/gridstack.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'],
// 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: ['PhantomJS'],
// 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
})
}

View file

@ -25,7 +25,13 @@
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-uglify": "^0.10.1",
"grunt-doctoc": "^0.1.1",
"grunt-sass": "^1.1.0",
"grunt-doctoc": "^0.1.1"
"jasmine-core": "^2.4.1",
"karma": "^0.13.21",
"karma-jasmine": "^0.3.7",
"karma-phantomjs-launcher": "^1.0.0",
"phantomjs": "^2.1.3",
"phantomjs-prebuilt": "^2.1.4"
}
}