Skip to content

Commit 1dd57ca

Browse files
author
deepsweet
committed
Istanbul + coveralls.io
1 parent 547bbc4 commit 1dd57ca

File tree

10 files changed

+44
-16
lines changed

10 files changed

+44
-16
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12-
[GNUmakefile]
12+
[Makefile]
1313
indent_style = tab
1414

1515
[package.json]

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
lib-cov/
33
html-report/
4+
lcov.info
45
bin/svgo-profiling
56
*.sublime-*
67
*.log

.travis.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ node_js:
66
- 0.10
77
- 0.11
88

9+
matrix:
10+
allow_failures:
11+
- node_js: 0.11
12+
13+
914
branches:
1015
only:
1116
- master
1217

13-
matrix:
14-
allow_failures:
15-
- node_js: 0.11
18+
script: make travis

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
test:
2+
@NODE_ENV=test ./node_modules/.bin/mocha
3+
4+
lib-cov:
5+
@./node_modules/.bin/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib
6+
7+
coverage: lib-cov
8+
@COVERAGE=1 ISTANBUL_REPORTERS=text-summary ./node_modules/.bin/mocha --reporter mocha-istanbul
9+
@rm -rf lib-cov
10+
11+
coveralls: lib-cov
12+
@COVERAGE=1 ISTANBUL_REPORTERS=lcovonly ./node_modules/.bin/mocha --reporter mocha-istanbul
13+
@cat lcov.info | ./node_modules/.bin/coveralls
14+
@rm -rf lib-cov lcov.info
15+
16+
travis: test coveralls
17+
18+
jshint:
19+
@jshint --show-non-errors .
20+
21+
.PHONY: test

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<img src="http://soulshine.in/svgo.svg" width="200" height="200" alt="logo"/>
55

6-
## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
6+
## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://coveralls.io/repos/svg/svgo/badge.png?branch=master)](https://coveralls.io/r/svg/svgo)
77

88
**SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.
99
![](https://mc.yandex.ru/watch/18431326)

README.ru.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<img src="http://soulshine.in/svgo.svg" width="200" height="200" alt="logo"/>
55

6-
## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
6+
## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://coveralls.io/repos/svg/svgo/badge.png?branch=master)](https://coveralls.io/r/svg/svgo)
77

88
**SVG** **O**ptimizer – это инструмент для оптимизации векторной графики в формате SVG, написанный на Node.js.
99
![](https://mc.yandex.ru/watch/18431326)

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
"example": "./examples"
3333
},
3434
"scripts": {
35-
"test": "./node_modules/.bin/mocha",
36-
"cover": "./node_modules/.bin/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib && ./node_modules/.bin/mocha --reporter mocha-istanbul --recursive",
37-
"jshint": "jshint --show-non-errors ."
35+
"test": "make test"
3836
},
3937
"dependencies": {
4038
"sax": "~0.5.0",
@@ -47,7 +45,8 @@
4745
"mocha": "~1.9.0",
4846
"should": "~1.2.0",
4947
"istanbul": "~0.1.0",
50-
"mocha-istanbul": ""
48+
"mocha-istanbul": "",
49+
"coveralls": ""
5150
},
5251
"engines": {
5352
"node": ">=0.6.0"

test/config/_index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

3-
var cover = process.argv[3] === 'mocha-istanbul',
4-
CONFIG = require(cover ? '../../lib-cov/svgo/config' : '../../lib/svgo/config');
3+
var CONFIG = require(process.env.COVERAGE ?
4+
'../../lib-cov/svgo/config' :
5+
'../../lib/svgo/config');
56

67
describe('config', function() {
78

test/plugins/_index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
var FS = require('fs'),
44
PATH = require('path'),
55
regFilename = /^(.*)\.(\d+)\.svg$/,
6-
SVGO = require('../../lib/svgo');
6+
SVGO = require(process.env.COVERAGE ?
7+
'../../lib-cov/svgo':
8+
'../../lib/svgo');
79

810
describe('plugins tests', function() {
911

test/svg2js/_index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
var SHOULD = require('should'),
44
FS = require('fs'),
55
PATH = require('path'),
6-
cover = process.argv[3] === 'mocha-istanbul',
7-
svg2js = require(cover ? '../../lib-cov/svgo/svg2js' : '../../lib/svgo/svg2js');
6+
SVG2JS = require(process.env.COVERAGE ?
7+
'../../lib-cov/svgo/svg2js' :
8+
'../../lib/svgo/svg2js');
89

910
describe('svg2js', function() {
1011

@@ -20,7 +21,7 @@ describe('svg2js', function() {
2021
throw err;
2122
}
2223

23-
svg2js(data, function(result) {
24+
SVG2JS(data, function(result) {
2425
root = result;
2526
done();
2627
});

0 commit comments

Comments
 (0)