1 Star 0 Fork 70

jp51986 / rsuite

forked from rsuite / rsuite 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
karma.conf.js 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
Godfery 提交于 2019-08-26 14:35 . Added some styles test case. (#571)
/**
* Run all tests: `npm run tdd`
* Run all styles tests: `M=styles npm run tdd`
* Run a component test: `M=Button npm run tdd`
* Run a test of a file: `src/Picker/test/PickerToggleSpec.js npm run tdd`
*/
const path = require('path');
const webpackConfig = {
output: {
pathinfo: true
},
mode: 'development',
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
'@test': path.resolve(__dirname, './test')
}
},
module: {
rules: [
{
test: [/\.tsx?$/, /\.jsx?$/],
use: ['babel-loader?babelrc'],
exclude: /node_modules/
},
{
test: /\.(less|css)$/,
use: [
{
loader: 'style-loader' // creates style nodes from JS strings
},
{
loader: 'css-loader' // translates CSS into CommonJS
},
{
loader: 'less-loader', // compiles Less to CSS,
options: {
javascriptEnabled: true
}
}
]
}
]
}
};
module.exports = config => {
const { env } = process;
const { M, F } = env;
let testFile = 'test/index.js';
if (M) {
testFile = `src/${M}/test/*.js`;
} else if (F) {
testFile = F;
}
config.set({
basePath: '',
files: [testFile],
frameworks: ['mocha', 'sinon-chai'],
colors: true,
reporters: ['mocha', 'coverage'],
logLevel: config.LOG_INFO,
preprocessors: {
'test/*.js': ['webpack'],
'src/**/*.js': ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'],
customLaunchers: {
ChromeCi: {
base: 'Chrome',
flags: ['--no-sandbox']
},
FirefoxAutoAllowGUM: {
base: 'Firefox',
prefs: {
'media.navigator.permission.disabled': true
}
}
},
coverageReporter: {
dir: 'coverage',
reporters: [
{ type: 'html' },
{ type: 'lcov', subdir: 'lcov' } // lcov
]
}
});
};
TypeScript
1
https://gitee.com/jp51986/rsuite.git
git@gitee.com:jp51986/rsuite.git
jp51986
rsuite
rsuite
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891