Skip to content

Commit

Permalink
fix: TypeError when watchOptions.ignored is not an array - fixes #1563
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Jun 9, 2018
1 parent dd70eba commit 90e7306
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/cli/transforms/copyCLIIgnoreToWatchOptions.ts
Expand Up @@ -5,7 +5,6 @@ export function copyCLIIgnoreToWatchOptions(incoming) {
return incoming;
}
return incoming.updateIn(["watchOptions", "ignored"], List([]), ignored => {
const userIgnore = List([]).concat(incoming.get("ignore"));
return ignored.concat(userIgnore);
return List([]).concat(ignored, incoming.get("ignore"));
});
}
13 changes: 13 additions & 0 deletions test/specs/cli/cli.options.watch.js
Expand Up @@ -122,4 +122,17 @@ describe("CLI: Options: Merging Watch Option", function() {
config.getIn(["watchOptions", "ignored"]).contains("*.json2")
);
});
it("merges from server, serveStatic + ignore path + watchOptions.ignore (string)", function() {
var input = {
server: ["."],
watch: true,
ignore: ["*.json", "*.json2"],
watchOptions: { ignored: "*.txt" }
};
var config = merge(input);

assert.ok(config.getIn(["watchOptions", "ignored"]).contains("*.json"));
assert.ok(config.getIn(["watchOptions", "ignored"]).contains("*.json2"));
assert.ok(config.getIn(["watchOptions", "ignored"]).contains("*.txt"));
});
});

0 comments on commit 90e7306

Please sign in to comment.