Testing with karma, mocha and chai

This commit is contained in:
Mark Striemer 2015-06-10 13:13:25 -05:00
Родитель 089ac9ff95
Коммит 42e0a52606
3 изменённых файлов: 95 добавлений и 0 удалений

20
.travis.yml Normal file
Просмотреть файл

@ -0,0 +1,20 @@
sudo: false
branches:
only:
- master
notifications:
email: false
language: node_js
node_js:
- '0.10'
before_script:
- npm install
- bower install
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script:
- karma start --single-run
cache:
directories:
- node_modules
- bower_components

67
karma.conf.js Normal file
Просмотреть файл

@ -0,0 +1,67 @@
// Karma configuration
// Generated on Tue Jun 09 2015 21:41:12 GMT-0500 (CDT)
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', 'chai'],
// list of files / patterns to load in the browser
files: [
'bower_components/document-register-element/build/document-register-element.js',
'marketplace-elements.js',
'tests/test-*.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: ['mocha'],
// 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: ['Firefox'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};

Просмотреть файл

@ -11,6 +11,14 @@
"npm": ">= 1.1.x"
},
"dependencies": {
"bower": "^1.4.1",
"chai": "^3.0.0",
"karma": "^0.12.36",
"karma-chai": "^0.1.0",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.1.10",
"karma-mocha-reporter": "^1.0.2",
"mocha": "^2.2.5",
"stylus": "0.32.x"
}
}