Skip to content

Commit

Permalink
fix polling test on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 8, 2019
1 parent d1dafe2 commit f1449f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
12 changes: 12 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -17,6 +17,12 @@ jobs:
node-10-poll:
node_version: ^10.10.0
polling: 200
node-8-poll:
node_version: ^8.12.0
polling: 200
node-6-poll:
node_version: ^6.16.0
polling: 200
steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -99,6 +105,12 @@ jobs:
node-10-poll:
node_version: ^10.10.0
polling: 200
node-8-poll:
node_version: ^8.12.0
polling: 200
node-6-poll:
node_version: ^6.16.0
polling: 200
steps:
- task: NodeTool@0
inputs:
Expand Down
1 change: 0 additions & 1 deletion lib/DirectoryWatcher.js
Expand Up @@ -75,7 +75,6 @@ class DirectoryWatcher extends EventEmitter {

createWatcher() {
try {
const options = this.options;
// TODO options.ignored
if(this.polledWatching) {
const listener = this.onWatchFileEvent.bind(this);
Expand Down
2 changes: 1 addition & 1 deletion test/DirectoryWatcher.test.js
Expand Up @@ -161,7 +161,7 @@ describe("DirectoryWatcher", function() {
});
});

if(!process.env.WATCHPACK_POLLING) {
if(!+process.env.WATCHPACK_POLLING) {
it("should log errors emitted from watcher to stderr", function(done) {
var error_logged = false;
var old_stderr = process.stderr.write
Expand Down
14 changes: 8 additions & 6 deletions test/Watchpack.js
Expand Up @@ -610,12 +610,14 @@ describe("Watchpack", function() {
w.on("aggregated", function(changes, removals) {
step.should.be.eql(6);
Array.from(removals).sort().should.be.eql([path.join(fixtures, "a"), path.join(fixtures, "b")]);
removeEvents.should.be.eql([
path.join(fixtures, "a"),
path.join(fixtures, "b"),
path.join(fixtures, "a"),
path.join(fixtures, "b"),
]);
if(!+process.env.WATCHPACK_POLLING) {
removeEvents.should.be.eql([
path.join(fixtures, "a"),
path.join(fixtures, "b"),
path.join(fixtures, "a"),
path.join(fixtures, "b"),
]);
}
Object.keys(w.getTimes()).sort().should.be.eql([
path.join(fixtures, "a"),
path.join(fixtures, "b")
Expand Down

0 comments on commit f1449f0

Please sign in to comment.