mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
* initial work * new client: working navigation and tasks showing up * finish header menu and add avatar component * fix sprites in new client * initial header version * initial styling for top menu * more progress on the header menu * almost complete menu and avatar * correctly apply active class for /social and /help * fix header colors and simplify css * switch from Roboto to native fonts * remove small avatar and add viewport * fixes * fix user menu with and progress bars * fix avatar rendeting * move bars colors to theme * add site overrides * fix tests * shrinkwrap * fix sprites path * another try at fixing the sprites path * another try at fixing the sprites path
79 lines
2.1 KiB
JavaScript
79 lines
2.1 KiB
JavaScript
// This is a karma config file. For more details see
|
|
// http://karma-runner.github.io/0.13/config/configuration-file.html
|
|
// we are also using it with karma-webpack
|
|
// https://github.com/webpack/karma-webpack
|
|
|
|
var path = require('path');
|
|
var merge = require('webpack-merge');
|
|
var baseConfig = require('../../../webpack/webpack.base.conf');
|
|
var utils = require('../../../webpack/utils');
|
|
var webpack = require('webpack');
|
|
var projectRoot = path.resolve(__dirname, '../../../');
|
|
|
|
var webpackConfig = merge(baseConfig, {
|
|
// use inline sourcemap for karma-sourcemap-loader
|
|
module: {
|
|
loaders: utils.styleLoaders(),
|
|
},
|
|
devtool: '#inline-source-map',
|
|
vue: {
|
|
loaders: {
|
|
js: 'isparta',
|
|
},
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env': require('../../../webpack/config/test.env'),
|
|
}),
|
|
],
|
|
});
|
|
|
|
// no need for app entry during tests
|
|
delete webpackConfig.entry;
|
|
|
|
// make sure isparta loader is applied before eslint
|
|
webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || [];
|
|
webpackConfig.module.preLoaders.unshift({
|
|
test: /\.js$/,
|
|
loader: 'isparta',
|
|
include: [
|
|
path.resolve(projectRoot, 'website/client'),
|
|
path.resolve(projectRoot, 'website/common'),
|
|
],
|
|
});
|
|
|
|
// only apply babel for test files when using isparta
|
|
webpackConfig.module.loaders.some(function (loader, i) {
|
|
if (loader.loader === 'babel') {
|
|
loader.include = path.resolve(projectRoot, 'test/client/unit');
|
|
return true;
|
|
}
|
|
});
|
|
|
|
module.exports = function (config) {
|
|
config.set({
|
|
// to run in additional browsers:
|
|
// 1. install corresponding karma launcher
|
|
// http://karma-runner.github.io/0.13/config/browsers.html
|
|
// 2. add it to the `browsers` array below.
|
|
browsers: ['PhantomJS'],
|
|
frameworks: ['mocha', 'sinon-chai'],
|
|
reporters: ['spec', 'coverage'],
|
|
files: ['./index.js'],
|
|
preprocessors: {
|
|
'./index.js': ['webpack', 'sourcemap'],
|
|
},
|
|
webpack: webpackConfig,
|
|
webpackMiddleware: {
|
|
noInfo: true,
|
|
},
|
|
coverageReporter: {
|
|
dir: './coverage',
|
|
reporters: [
|
|
{ type: 'lcov', subdir: '.' },
|
|
{ type: 'text-summary' },
|
|
],
|
|
},
|
|
});
|
|
};
|