Refactor code

This commit is contained in:
Tyler Long
2017-04-17 00:12:30 +08:00
parent 8b44401b1b
commit 3ac23c21d9
8 changed files with 35 additions and 47 deletions

View File

@@ -4,14 +4,14 @@
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
// 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 to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['browserify', 'jasmine'],
// list of files / patterns to load in the browser
// list of files / patterns to load in the browser
files: [
'./src/*.spec.js',
'./src/diagrams/flowchart/**/*.spec.js',
@@ -23,46 +23,46 @@ module.exports = function (config) {
],
preprocessors: {
'src/**/*.spec.js': [ 'browserify' ]
'src/**/*.spec.js': ['browserify']
},
// list of files to exclude
// exclude: ['src/diagrams/*.js'],
// list of files to exclude
// exclude: ['src/diagrams/*.js'],
browserify: {
debug: true,
// plugin: ['proxyquireify/plugin']
// plugin: ['proxyquireify/plugin']
extensions: ['.js'],
configure: function (bundle) {
bundle.on('prebundle', function () {
bundle
.plugin('proxyquire-universal')
.plugin('proxyquire-universal')
})
}
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['dots'],
// web server port
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
// 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
// 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
// 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
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
plugins: [
'karma-jasmine',
@@ -70,8 +70,8 @@ module.exports = function (config) {
'karma-browserify',
'karma-babel-preprocessor'
],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
})
}