Skip to content

Commit

Permalink
chore(release): Release v0.1.5, Add coverage reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanchen committed Mar 31, 2017
1 parent 801d1af commit ef3e743
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-screenshot",
"version": "0.1.4",
"version": "0.1.5",
"authors": [
"weihanchen"
],
Expand Down
2 changes: 1 addition & 1 deletion build/angular-screenshot.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Screenshot - v0.1.4 - http://weihanchen.github.io/angular-screenshot - (c) 2017 weihanchen - MIT */
/*! Angular Screenshot - v0.1.5 - http://weihanchen.github.io/angular-screenshot - (c) 2017 weihanchen - MIT */
.screenshot-toolbox button {
margin: 0.2em; }

Expand Down
2 changes: 1 addition & 1 deletion build/angular-screenshot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Screenshot - v0.1.4 - http://weihanchen.github.io/angular-screenshot - (c) 2017 weihanchen - MIT */
/*! Angular Screenshot - v0.1.5 - http://weihanchen.github.io/angular-screenshot - (c) 2017 weihanchen - MIT */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
Expand Down
2 changes: 1 addition & 1 deletion build/angular-screenshot.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/angular-screenshot.min.js

Large diffs are not rendered by default.

46 changes: 35 additions & 11 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
'use strict';
const webpackConfig = require('./webpack.config'),
path = require('path'),
generateJsonPlugin = require('generate-json-webpack-plugin');
webpackConfig.devtool = 'source-map';
webpackConfig.plugins = webpackConfig.plugins.filter(plugin => !(plugin instanceof generateJsonPlugin));
// webpackConfig.module.postLoaders = [{
// test: /\.js$/,
// exclude: /(test|node_modules|bower_components)\//,
// loader: 'istanbul-instrumenter'
// }];
webpackConfig.module.loaders.push({
test: /\.js$/,
include: path.resolve('src/'),
loader: 'istanbul-instrumenter-loader',
query: {
esModules: true
}
});
module.exports = (config) => {
const configuration = {
basePath: '',
Expand All @@ -18,6 +22,7 @@ module.exports = (config) => {
'node_modules/angular-mocks/angular-mocks.js',
{ pattern: 'test/index.js', watched: false }],
plugins: [
'karma-coverage-istanbul-reporter',
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-mocha',
Expand All @@ -28,17 +33,36 @@ module.exports = (config) => {
require("karma-webpack")
],
preprocessors: {
'test/index.js': ['webpack', 'sourcemap', 'coverage']
'test/index.js': ['coverage', 'webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: "errors-only"
},
coverageReporter: {
type: 'lcov',
dir: 'coverage/'
coverageIstanbulReporter: {

// reports can be any that are listed here: https://github.com/istanbuljs/istanbul-reports/tree/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib
reports: ['html', 'lcovonly', 'text-summary'],

// base output directory. If you include %browser% in the path it will be replaced with the karma browser name
dir: path.join(__dirname, 'coverage'),

// if using webpack and pre-loaders, work around webpack breaking the source path
fixWebpackSourcePaths: true,

// Most reporters accept additional config options. You can pass these through the `report-config` option
'report-config': {

// all options available at: https://github.com/istanbuljs/istanbul-reports/blob/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib/html/index.js#L135-L137
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}

}
},
reporters: ['mocha', 'coverage'],

reporters: ['mocha', 'coverage-istanbul'],
mochaReporter: {
output: 'full'
},
Expand All @@ -48,7 +72,7 @@ module.exports = (config) => {
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_DEBUG,
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-screenshot",
"version": "0.1.4",
"version": "0.1.5",
"description": "Angular screenshot in directive for screen capture.",
"main": "dist/angular-screenshot.js",
"repository": {
Expand Down Expand Up @@ -67,6 +67,7 @@
"jquery": "^3.2.1",
"karma": "^1.5.0",
"karma-coverage": "^1.1.1",
"karma-coverage-istanbul-reporter": "^1.0.0",
"karma-coveralls": "^1.1.2",
"karma-jasmine": "^1.1.0",
"karma-mocha": "^1.3.0",
Expand Down
6 changes: 5 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

const testsContext = require.context('.', true, /\.spec\.js/);
testsContext.keys().forEach(testsContext);
testsContext.keys().forEach(testsContext);

const componentsContext = require.context('../src/', true, /angular-screenshot\.js$/);

componentsContext.keys().forEach(componentsContext);

0 comments on commit ef3e743

Please sign in to comment.