Skip to content

Commit

Permalink
Format and lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amasad committed May 30, 2017
1 parent 34defa0 commit 5195f7b
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 107 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
],
"scripts": {
"prepublish": "jshint --config=.jshintrc src/ index.js && mocha --bail",
"test": "npm run format && eslint src/ index.js && mocha --bail test/test.js && mocha --bail test/utils-test.js",
"test": "npm run format && eslint src/ test/ index.js && mocha --bail test/test.js && mocha --bail test/utils-test.js",
"test:debug": "mocha debug --bail",
"format": "prettier --trailing-comma es5 --single-quote --write index.js 'src/**/*.js'"
"format": "prettier --trailing-comma es5 --single-quote --write index.js 'src/**/*.js' 'test/**/*.js'"
},
"bin": "./src/cli.js",
"keywords": [
Expand Down
18 changes: 11 additions & 7 deletions test/plugin_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ function PluginTestWatcher(dir, opts) {

watch.createMonitor(
this.root,
{ interval: opts.interval || DEFAULT_DELAY,
filter: this.filter.bind(this)
{
interval: opts.interval || DEFAULT_DELAY,
filter: this.filter.bind(this),
},
this.init.bind(this)
);
Expand All @@ -61,11 +62,14 @@ PluginTestWatcher.prototype.__proto__ = EventEmitter.prototype;
*/

PluginTestWatcher.prototype.filter = function(filepath, stat) {
return stat.isDirectory() || common.isFileIncluded(
this.globs,
this.dot,
this.doIgnore,
path.relative(this.root, filepath)
return (
stat.isDirectory() ||
common.isFileIncluded(
this.globs,
this.dot,
this.doIgnore,
path.relative(this.root, filepath)
)
);
};

Expand Down
Loading

0 comments on commit 5195f7b

Please sign in to comment.