Skip to content

Commit

Permalink
Merge pull request #460 from bem/istanbul-cov
Browse files Browse the repository at this point in the history
Add istanbul coverage report generation
  • Loading branch information
Vladimir Varankin committed Apr 1, 2014
2 parents a281f1e + 6e4631b commit 55ca806
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
19 changes: 11 additions & 8 deletions .bem/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ MAKE.decl('Arch', {
blocksLevelsRegexp : /^.+?\.blocks$/,
bundlesLevelsRegexp : /^.+?\.bundles$/,

libraries : [],

createCustomNodes : function(common, libs, blocks) {
var SetsNode = MAKE.getNodeClass('SetsNode');

if(typeof SetsNode.createId === 'undefined') {
return;
}

return new SetsNode({ root : this.root, arch : this.arch }).alterArch(null, libs);
return new SetsNode({ root : this.root, arch : this.arch }).alterArch();
}

});
Expand Down Expand Up @@ -120,11 +118,16 @@ MAKE.decl('ExampleNode', {
MAKE.decl('SpecNode', {

getTechs : function() {
return this.__base()
.concat([
'spec.js+browser.js+bemhtml',
'phantomjs'
]);
return [
'bemjson.js',
'bemdecl.js',
'deps.js',
'css',
'spec.js+browser.js+bemhtml',
'bemhtml',
'html',
'phantomjs'
];
},

getLevels : function() {
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
libs
node_modules

coverage.json
/coverage

*.bundles/*/*
!*.bundles/.bem/*
!*.bundles/*/blocks
Expand Down
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
language: node_js

node_js:
- "0.10"
- "0.11"
- 0.10
- 0.11

env:
global:
- GH_REF: github.com/bem/bem-core.git
- ISTANBUL_COVERAGE: yes

matrix:
allow_failures:
- node_js: "0.11"
- node_js: 0.11

branches:
only:
- v1
- v2

after_success:
- npm install coveralls
- ./node_modules/.bin/istanbul report lcovonly
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && echo "Coverage data was sent to coveralls!"

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Sergey Belov <peimei@ya.ru>"
],
"devDependencies": {
"bem-pr": "git://github.com/narqo/bem-pr.git#~0.6.1"
"bem-pr": "git://github.com/narqo/bem-pr.git#^0.7.0"
},
"license": "MIT",
"private": true,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"jshint-groups": "0.6.0",
"jscs": "1.0.0",
"git-hooks": "0.0.3",
"bower-npm-install": "~0.5.4"
"bower-npm-install": "~0.5.4",
"istanbul": "^0.2.6"
},
"scripts": {
"lint": "jshint-groups && jscs .",
"libs": "bower-npm-install",
"bem-test": "npm run libs && bem make -w 5 sets",
"bem-test": "npm run libs && bem make -w 10 desktop.specs touch.specs",
"bem-coverage": "ISTANBUL_COVERAGE=yes npm run bem-test",
"test": "npm run bem-test && mocha --ui tdd --reporter spec common.blocks/i-bem/i-bem.test.bemhtml/*-test.js common.blocks/i-bem/__i18n/test/*-test.js common.blocks/i-bem/__i18n/i-bem__i18n.test.bemhtml/*-test.js"
}
}

0 comments on commit 55ca806

Please sign in to comment.