Skip to content

Commit

Permalink
attempt to updated/simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
tivac committed Jul 19, 2017
1 parent 2d6730b commit 9350a97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
23 changes: 2 additions & 21 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
/* global danger, fail, warn */
/* global message, danger */
"use strict";

var fs = require("fs"),
path = require("path"),
locater = require("locater")


var jsfiles = danger.git.created_files
.concat(danger.git.modified_files)
.filter((file) => path.extname(file) === ".js")

// Be careful of leaving testing shortcuts in the codebase
jsfiles
.filter((file) => file.indexOf("test/") > -1)
.forEach((file) => {
var code = fs.readFileSync(file, "utf8"),
locs = locater.find("o.only", code)

locs.forEach((loc) =>
fail(`${file} is prevent all tests from running ${loc.line}:${loc.cursor}`)
)
});
message("OK, this worked @" + danger.github.pr.user.login)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"benchmark": "^2.1.4",
"danger": "^0.15.0",
"danger": "^0.16.0",
"eslint": "^3.19.0",
"istanbul": "^0.4.5",
"locater": "^1.3.0",
Expand Down

0 comments on commit 9350a97

Please sign in to comment.