Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
188 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
repo_token: 5oaByIGLTXskkkwvka0EkcaERYYc64HQR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- 4.0 | ||
before_script: | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
script: | ||
- npm test | ||
- sh -e /etc/init.d/xvfb start |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,165 @@ | ||
module.exports = require('./karma.config-gen.js')(); | ||
/** | ||
* karma 测试配置文件 | ||
* @author ydr.me | ||
* @create 2016-04-20 21:15 | ||
*/ | ||
|
||
|
||
'use strict'; | ||
|
||
|
||
var TRAVIS = process.env.TRAVIS; | ||
|
||
// http 服务器 | ||
var httpServer = function (req, res, next) { | ||
next(); | ||
}; | ||
|
||
|
||
module.exports = function (config) { | ||
var browsers = []; | ||
var reporters = ['progress', 'coverage']; | ||
var coverageReporters = [{ | ||
type: 'text-summary' | ||
}]; | ||
|
||
if (TRAVIS) { | ||
browsers = ['Chrome_travis_ci']; | ||
reporters.push('coveralls'); | ||
coverageReporters.push({ | ||
type: 'lcov', | ||
dir: './coverage/' | ||
}); | ||
} else { | ||
browsers = ['Chrome']; | ||
} | ||
|
||
|
||
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', 'coolie'], | ||
|
||
|
||
client: {}, | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
{ | ||
// 加载 src 下的原始文件,但不直接引入,使用模块加载器引入 | ||
pattern: './src/**', | ||
included: false | ||
}, | ||
{ | ||
// 加载 node_modules 下的原始文件,但不直接引入,使用模块加载器引入 | ||
pattern: './node_modules/blear.*/package.json', | ||
included: false | ||
}, | ||
{ | ||
// 加载 node_modules 下的原始文件,但不直接引入,使用模块加载器引入 | ||
pattern: './node_modules/blear.*/src/**', | ||
included: false | ||
}, | ||
{ | ||
// 加载 src 下的原始文件,但不直接引入,使用模块加载器引入 | ||
pattern: './test/test.**', | ||
included: false | ||
}, | ||
{ | ||
// 加载 test 下的入口文件,但不直接引入,使用模块加载器引入 | ||
pattern: './test/main.js', | ||
included: true | ||
} | ||
], | ||
|
||
|
||
// list of files to exclude | ||
include: [], | ||
exclude: [], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
// 原始模块,需要测试覆盖率 | ||
'./src/index.js': ['coverage'] | ||
}, | ||
|
||
|
||
// optionally, configure the reporter | ||
// 覆盖率报告 | ||
coverageReporter: { | ||
reporters: coverageReporters | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
// 报告类型 | ||
reporters: reporters, | ||
|
||
|
||
// 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: browsers, | ||
|
||
|
||
// 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, | ||
|
||
|
||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
|
||
|
||
middleware: ['httpServer'], | ||
|
||
|
||
// plugins | ||
plugins: ['karma-*', { | ||
'middleware:httpServer': [ | ||
'factory', function () { | ||
return httpServer; | ||
} | ||
] | ||
}] | ||
}); | ||
}; | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
# blear.utils.compatible | ||
|
||
[![Build Status][travis-img]][travis-url] | ||
[![npm module][npm-img]][npm-url] | ||
[![build status][travis-img]][travis-url] | ||
[![coverage][coveralls-img]][coveralls-url] | ||
|
||
[travis-img]: https://travis-ci.org/blearjs/blear.utils.compatible.svg?branch=master | ||
[travis-img]: https://img.shields.io/travis/blearjs/blear.utils.compatible/master.svg?maxAge=2592000&style=flat-square | ||
[travis-url]: https://travis-ci.org/blearjs/blear.utils.compatible | ||
|
||
[npm-img]: https://img.shields.io/npm/v/blear.utils.compatible.svg?maxAge=2592000&style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/blear.utils.compatible | ||
|
||
[coveralls-img]: https://img.shields.io/coveralls/blearjs/blear.utils.compatible/master.svg?maxAge=2592000&style=flat-square | ||
[coveralls-url]: https://coveralls.io/github/blearjs/blear.utils.compatible?branch=master | ||
|