Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Move coverage script to Makefile" #505

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
29 changes: 24 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

node_modules
npm-debug.log

build
vagrant
.lock-wscript
.DS_Store
.sass-cache
bin
!bin/node-sass
build
lib-cov
node_modules

bin/*-v8-*

lib-coverage/
sass-coverage.js
**/fixtures/**/build.*
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"gypfile": true,
"scripts": {
"coverage": "make test-cov",
"coverage": "node scripts/coverage",
"install": "node lib/build.js",
"prepublish": "node scripts/prepublish",
"pretest": "node_modules/.bin/jshint bin lib test",
Expand Down
26 changes: 26 additions & 0 deletions scripts/coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env node
/*jshint shelljs:true */

"use strict";

require("shelljs/make");
var path = require("path");

var JSCOVERAGE_BIN = ["node_modules", ".bin", "jscoverage"].join(path.sep);
var COVERALLS_BIN = ["node_modules", ".bin", "coveralls"].join(path.sep);
var MOCHA_BIN = ["node_modules", ".bin", "mocha"].join(path.sep);

echo("Creating coverage files");
exec(JSCOVERAGE_BIN + " lib lib-cov");

echo("Piping mocha to coveralls");

env["NODESASS_COV"] = 1;

exec(MOCHA_BIN + " test -R mocha-lcov-reporter | " + COVERALLS_BIN, {async: false}, function(code, output) {
console.log('Exit code:', code);
console.log('Program output:', output);

echo("Cleanup coverage files");
rm("-R", "lib-cov");
});