Repository: eslint/eslint
File: tests/lib/cli-engine/file-enumerator.js (JavaScript)

Code before:
                        });
                    }, `No files matching '${filename}' were found.`);
                });

                it("should throw if a folder that does not have any applicable files is linted", () => {
                    const filename = getFixturePath("glob-util", "empty");
                    const patterns = [filename];

                    assert.throws(() => {
                        listFiles(patterns, {
                            cwd: getFixturePath()
                        });
                    }, `No files matching '${filename}' were found.`);
                });

                it("should throw if only ignored files match a glob", () => {
                    const pattern = getFixturePath("glob-util", "ignored");
                    const options = { ignore: true, ignorePath: getFixturePath("glob-util", "ignored", ".eslintignore") };

                    assert.throws(() => {
                        listFiles([pattern], options);
                    }, `All files matched by '${pattern}' are ignored.`);
                });

                it("should throw an error if no files match a glob", () => {
                    const patterns = ["tests/fixtures/glob-util/ignored/**/*.js"];

                    assert.throws(() => {
                        listFiles(patterns, { cwd: getFixturePath("ignored-paths") });
                    }, `No files matching '${patterns[0]}' were found.`);
                });

                it("should return an ignored file, if ignore option is turned off", () => {
                    const options = { ignore: false };
                    const patterns = [getFixturePath("glob-util", "ignored", "**/*.js")];
                    const result = listFiles(patterns, options);

                    assert.strictEqual(result.length, 1);
                });

                it("should ignore a file from a glob if it matches a pattern in an ignore file", () => {
                    const options = { ignore: true, ignorePath: getFixturePath("glob-util", "ignored", ".eslintignore") };
                    const patterns = [getFixturePath("glob-util", "ignored", "**/*.js")];

                    assert.throws(() => {
                        listFiles(patterns, options);
                    }, `All files matched by '${patterns[0]}' are ignored.`);
                });

                it("should ignore a file from a glob if matching a specified ignore pattern", () => {
                    const options = { ignore: true, cliConfig: { ignorePatterns: ["foo.js"] }, cwd: getFixturePath() };

Review comment (suggestion):
```suggestion
                    const patterns = ["dir-does-not-exist/**/*.js"];
```

I think the change in this test case is generally fine because, according to its title, it was supposed to test a scenario where no files match a glob rather than when all matched files are ignored (for which there's already another test case), but this pattern looks confusing now when the `cwd` is `getFixturePath("ignored-paths")`.  

Code after:
                        });
                    }, `No files matching '${filename}' were found.`);
                });

                it("should throw if a folder that does not have any applicable files is linted", () => {
                    const filename = getFixturePath("glob-util", "empty");
                    const patterns = [filename];

                    assert.throws(() => {
                        listFiles(patterns, {
                            cwd: getFixturePath()
                        });
                    }, `No files matching '${filename}' were found.`);
                });

                it("should throw if only ignored files match a glob", () => {
                    const pattern = getFixturePath("glob-util", "ignored");
                    const options = { ignore: true, ignorePath: getFixturePath("glob-util", "ignored", ".eslintignore") };

                    assert.throws(() => {
                        listFiles([pattern], options);
                    }, `All files matched by '${pattern}' are ignored.`);
                });

                it("should throw an error if no files match a glob", () => {
                    const patterns = ["dir-does-not-exist/**/*.js"];

                    assert.throws(() => {
                        listFiles(patterns, { cwd: getFixturePath("ignored-paths") });
                    }, `No files matching '${patterns[0]}' were found.`);
                });

                it("should return an ignored file, if ignore option is turned off", () => {
                    const options = { ignore: false };
                    const patterns = [getFixturePath("glob-util", "ignored", "**/*.js")];
                    const result = listFiles(patterns, options);

                    assert.strictEqual(result.length, 1);
                });

                it("should ignore a file from a glob if it matches a pattern in an ignore file", () => {
                    const options = { ignore: true, ignorePath: getFixturePath("glob-util", "ignored", ".eslintignore") };
                    const patterns = [getFixturePath("glob-util", "ignored", "**/*.js")];

                    assert.throws(() => {
                        listFiles(patterns, options);
                    }, `All files matched by '${patterns[0]}' are ignored.`);
                });

                it("should ignore a file from a glob if matching a specified ignore pattern", () => {
                    const options = { ignore: true, cliConfig: { ignorePatterns: ["foo.js"] }, cwd: getFixturePath() };