Config file generated at “/home/charley/Desktop/myKarmDemo/karma.conf.js”.
初始化完成之后,会在我们的项目中生成一个 karma.conf.js 文件,这个文件就是 Karma 的配置文件。
配置文件比较简单,能够比较轻松的看懂,这里我对原始的配置文件进行简单的修改,结果如下:
// Karma configuration
// Generated on Sun Oct 29 2017 21:45:27 GMT+0800 (CST)
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: [
“./src/**/*.js”,
“./test/**/*.spec.js”,
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs