Skip to content

Commit

Permalink
add:react
Browse files Browse the repository at this point in the history
  • Loading branch information
yinsang committed Sep 20, 2018
1 parent 34bd786 commit 2315916
Show file tree
Hide file tree
Showing 10 changed files with 8,896 additions and 0 deletions.
10 changes: 10 additions & 0 deletions react-webpack-eslint-karma-unitTest/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
"extends": "standard",
"plugins":["html", "react"],
"rules":{
// 解决react报错
"react/jsx-uses-react":2,
// 解决var App 报错
"react/jsx-uses-vars":2,
}
};
13 changes: 13 additions & 0 deletions react-webpack-eslint-karma-unitTest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="root"></div>
<script src="./dist/main.js"></script>
</body>
</html>
72 changes: 72 additions & 0 deletions react-webpack-eslint-karma-unitTest/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Karma configuration
// Generated on Thu Sep 20 2018 14:10:15 GMT+0800 (GMT+08:00)

const webpackConfig = require('./webpack.config')
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: ['mocha'],


webpack:webpackConfig,
// list of files / patterns to load in the browser
files: [
'unit/test/**/*.test.js'
],


// list of files / patterns to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"unit/test/**/*.test.js":['webpack']
},


// 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: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
Loading

0 comments on commit 2315916

Please sign in to comment.