Skip to content

Instantly share code, notes, and snippets.

@Ratstail91
Last active March 5, 2017 22:28
Show Gist options
  • Save Ratstail91/00db50086d29222d72bab98ad0474ba4 to your computer and use it in GitHub Desktop.
Save Ratstail91/00db50086d29222d72bab98ad0474ba4 to your computer and use it in GitHub Desktop.
// Karma configuration
var webpackConfig = require('./webpack.config.js');
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/**/*.js*'
],
// list of files to exclude
exclude: [
'src/index.jsx'
],
proxies: {
'/refresh.cgi': {
'target': 'http://island.krgamestudios.com/refresh.cgi',
changeOrigin: true
},
'/entry.cgi': {
'target': 'http://island.krgamestudios.com/entry.cgi',
changeOrigin: true
}
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/**/*.js*': ['webpack', 'coverage'],
'scripts/**/*.js*': ['webpack', 'coverage'],
'test/**/*.js*': ['webpack', 'coverage']
},
webpack: webpackConfig,
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],
// 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: ['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
})
}
'target': 'http://island.krgamestudios.com/refresh.cgi',
changeOrigin: true
},
'/entry.cgi': {
'target': 'http://island.krgamestudios.com/entry.cgi',
changeOrigin: true
}
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/**/*.js*': ['webpack', 'coverage'],
'scripts/**/*.js*': ['webpack', 'coverage'],
'test/**/*.js*': ['webpack', 'coverage']
},
webpack: webpackConfig,
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],
// 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: ['PhantomJS'],
// 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
})
}
{
"name": "public_html",
"version": "1.0.0",
"description": "",
"main": "",
"scripts": {
"start": "webpack",
"test": "./node_modules/.bin/karma start karma.conf.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"jasmine-core": "^2.5.2",
"karma": "^1.5.0",
"webpack": "^2.2.1"
},
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-loader": "^6.3.2",
"babel-plugin-istanbul": "^4.0.0",
"babel-preset-env": "^1.2.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-webpack": "^2.0.2",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"redux": "^3.6.0",
"redux-devtools": "^3.3.2",
"redux-devtools-dock-monitor": "^1.1.1",
"redux-devtools-log-monitor": "^1.2.0",
"redux-thunk": "^2.1.0",
"semantic-ui-css": "^2.2.4",
"semantic-ui-react": "^0.64.0"
}
}
module.exports = {
entry: "./src/index.jsx",
output: {
path: "./",
filename: "output.bundle.js"
},
module: {
loaders: [
{
test: /\.jsx$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['istanbul']
}
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment