Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rizowski committed Sep 20, 2019
1 parent b82cc66 commit 47cf6ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/unit/cli/options-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('cli/options', () => {
--clear Clear terminal when running lint
-v, --version Prints Eslint-Watch Version
--versions Prints Eslint-Watch and Eslint Versions
--watch-ignore RegExp Regex string of folders to ignore when watching - default: /.git|node_modules|bower_components/
--watch-ignore RegExp Regex string of folders to ignore when watching - default: /.git|node_modules|bower_components|.eslintcache/
--watch-delay Int Delay(ms) for watcher to wait to trigger re-lint - default: 300
Basic configuration:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/events/chokidar-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ describe('events/chokidar', () => {

expect(chokidarStub.calledOnce).to.equal(true, 'chokidar was not called once');
expect(chokidarStub.firstCall.args[0]).to.eql(['.']);
expect(chokidarStub.firstCall.args[1]).to.eql({ ignored: /\.git|node_modules|bower_components/ });
expect(chokidarStub.firstCall.args[1]).to.eql({ ignored: /\.git|node_modules|bower_components|\.eslintcache/ });
});

it('merges default ignore paths', () => {
watch.createWatcher(['.'], { ignored: /build|dist/ });

expect(chokidarStub.firstCall.args[1]).to.eql({ ignored: /\.git|node_modules|bower_components|build|dist/ });
expect(chokidarStub.firstCall.args[1]).to.eql({ ignored: /\.git|node_modules|bower_components|\.eslintcache|build|dist/ });
});
});
12 changes: 6 additions & 6 deletions tests/unit/events/watch-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('events/watch', () => {
});

it('lints the directory when a change is detected', (done) => {
const opts = { _: ['./'], ext: ['.js'] };
const opts = { _: ['./'], ext: ['.js'], watchDelay: 0 };
watch.listen(opts);

emitter.emit('change', './some/path.js');
Expand All @@ -57,11 +57,11 @@ describe('events/watch', () => {
} catch (error) {
done(error);
}
}, 0);
}, 100);
});

it('lints the changed path when --changed is provided and a change is detected', (done) => {
const opts = { _: ['./'], changed: true, ext: ['.js'] };
const opts = { _: ['./'], changed: true, ext: ['.js'], watchDelay: 0 };
watch.listen(opts);

emitter.emit('change', './some/path.js');
Expand All @@ -74,7 +74,7 @@ describe('events/watch', () => {
} catch (error) {
done(error);
}
}, 0);
}, 100);
});

it('does not lint non js files', (done) => {
Expand All @@ -91,7 +91,7 @@ describe('events/watch', () => {
} catch (error) {
done(error);
}
}, 0);
}, 100);
});

it('runs an initial lint when the ready event is fired', (done) => {
Expand All @@ -108,6 +108,6 @@ describe('events/watch', () => {
} catch (error) {
done(error);
}
}, 0);
}, 100);
});
});

0 comments on commit 47cf6ce

Please sign in to comment.