diff options
tests - start migrating mascara tests to karma
Diffstat (limited to 'test')
-rw-r--r-- | test/base.conf.js | 59 | ||||
-rw-r--r-- | test/mascara.conf.js | 14 | ||||
-rw-r--r-- | test/together.conf.js | 8 |
3 files changed, 81 insertions, 0 deletions
diff --git a/test/base.conf.js b/test/base.conf.js new file mode 100644 index 000000000..122392822 --- /dev/null +++ b/test/base.conf.js @@ -0,0 +1,59 @@ +// Karma configuration +// Generated on Mon Sep 11 2017 18:45:48 GMT-0700 (PDT) + +module.exports = function(config) { + return { + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: process.cwd(), + + browserConsoleLogOptions: { + terminal: false, + }, + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['qunit'], + + // list of files / patterns to load in the browser + files: [ + 'test/integration/jquery-3.1.0.min.js', + { pattern: 'dist/chrome/images/**/*.*', watched: false, included: false, served: true }, + { pattern: 'dist/chrome/fonts/**/*.*', watched: false, included: false, served: true }, + ], + + proxies: { + '/images/': '/base/dist/chrome/images/', + '/fonts/': '/base/dist/chrome/fonts/', + }, + + // 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: false, + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Chrome', 'Firefox'], + + // 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 + } +} diff --git a/test/mascara.conf.js b/test/mascara.conf.js new file mode 100644 index 000000000..8e8fa2cdf --- /dev/null +++ b/test/mascara.conf.js @@ -0,0 +1,14 @@ +const getBaseConfig = require('./base.conf.js') + +module.exports = function(config) { + const settings = getBaseConfig(config) + settings.files.push('mascara/test/ui-bundle.js') + settings.files.push('mascara/test/test-bundle.js') + // settings.files.push('test/integration/bundle.js') + settings.files.push({ pattern: 'mascara/test/background.js', watched: false, included: false, served: true }), + // /background.js + + settings.proxies['/background.js'] = '/base/mascara/test/background.js' + + config.set(settings) +} diff --git a/test/together.conf.js b/test/together.conf.js new file mode 100644 index 000000000..cd2dbdcdc --- /dev/null +++ b/test/together.conf.js @@ -0,0 +1,8 @@ +const getBaseConfig = require('./base.conf.js') + +module.exports = function(config) { + const settings = getBaseConfig(config) + settings.files.push('development/bundle.js') + settings.files.push('test/integration/bundle.js') + config.set(settings) +} |