Skip to content

Commit 93df076

Browse files
committed
Fixed code coverage
1 parent affd447 commit 93df076

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

gulpfile.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ function runTests(singleRun, isCI, done) {
2020

2121
var files = [
2222
path.join(__dirname, 'test/vendor/*.js'), // PhantomJS 1.x polyfills
23-
path.join(__dirname, 'src/github.js'),
2423
path.join(__dirname, 'test/test.*.js')
2524
];
2625

2726
if (singleRun) {
28-
files.forEach(function(path) {
29-
preprocessors[path] = ['browserify', 'coverage'];
30-
});
27+
preprocessors['test/test.*.js'] = ['browserify'];
3128
reporters.push('coverage');
3229
}
3330

@@ -119,8 +116,10 @@ gulp.task('build', function() {
119116
.bundle()
120117
.pipe(source('github.js'))
121118
.pipe(buffer())
122-
.pipe(sourcemaps.init({loadMaps: true}))
123-
.pipe(uglify())
119+
.pipe(sourcemaps.init({
120+
loadMaps: true
121+
}))
122+
.pipe(uglify())
124123
.pipe(rename({
125124
extname: '.bundle.min.js'
126125
}))

karma.conf.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(config) {
1+
module.exports = function (config) {
22
'use strict';
33

44
var configuration = {
@@ -25,7 +25,8 @@ module.exports = function(config) {
2525
browsers: ['PhantomJS'],
2626

2727
browserify: {
28-
debug: true
28+
debug: true,
29+
transform: ['browserify-istanbul']
2930
},
3031

3132
phantomjsLauncher: {
@@ -40,11 +41,11 @@ module.exports = function(config) {
4041
coverageReporter: {
4142
reporters: [
4243
{
43-
type: 'lcov'
44-
},
45-
{
46-
type: 'text-summary'
47-
}
44+
type: 'lcov'
45+
},
46+
{
47+
type: 'text-summary'
48+
}
4849
],
4950
instrumenterOptions: {
5051
istanbul: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"browserify": "^13.0.0",
14+
"browserify-istanbul": "^0.2.1",
1415
"chai": "^3.4.1",
1516
"codecov": "^1.0.1",
1617
"del": "^2.2.0",

src/github.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'use strict';
1313

1414
(function (root, factory) {
15+
/* istanbul ignore next */
1516
if (typeof define === 'function' && define.amd) {
1617
define(['es6-promise', 'base-64', 'utf8', 'axios'], function (Promise, Base64, Utf8, axios) {
1718
return (root.Github = factory(Promise, Base64, Utf8, axios));

0 commit comments

Comments
 (0)