Repository: eslint/eslint
File: tests/lib/eslint/eslint.js (JavaScript)

Code before:
                overrideConfig: {
                    ignorePatterns: "tests/fixtures/single-quoted.js"
                }
            });

            await assert.rejects(async () => {
                await eslint.lintFiles(["tests/fixtures/*-quoted.js"]);
            }, /All files matched by 'tests\/fixtures\/\*-quoted\.js' are ignored\./u);
        });

        it("should not throw an error when ignorePatterns is an empty array", async () => {
            eslint = new ESLint({
                useEslintrc: false,
                overrideConfig: {
                    ignorePatterns: []
                }
            });

            await assert.doesNotReject(async () => {
                await eslint.lintFiles(["*.js"]);
            });
        });

        it("should return a warning when an explicitly given file is ignored", async () => {
            eslint = new ESLint({
                ignorePath: getFixturePath(".eslintignore"),
                cwd: getFixturePath()
            });
            const filePath = getFixturePath("passing.js");
            const results = await eslint.lintFiles([filePath]);

            assert.strictEqual(results.length, 1);
            assert.strictEqual(results[0].filePath, filePath);
            assert.strictEqual(results[0].messages[0].severity, 1);
            assert.strictEqual(results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
            assert.strictEqual(results[0].errorCount, 0);
            assert.strictEqual(results[0].warningCount, 1);
            assert.strictEqual(results[0].fatalErrorCount, 0);
            assert.strictEqual(results[0].fixableErrorCount, 0);
            assert.strictEqual(results[0].fixableWarningCount, 0);
        });

        it("should return two messages when given a file in excluded files list while ignore is off", async () => {
            eslint = new ESLint({
                ignorePath: getFixturePath(".eslintignore"),
                ignore: false,
                overrideConfig: {
                    rules: {
                        "no-undef": 2
                    }
                }

Review comment (suggestion):
This test doesn't seem related to this change. Perhaps you intended to check a constructor option that used to accept empty arrays, like `rulePaths`?

```suggestion
        it("should not throw an error when rulePaths is an empty array", async () => {
            eslint = new ESLint({
                useEslintrc: false,
                rulePaths: []
```

Code after:
            // Only `brackets/index.js` should be linted. Other files in `brackets/` should be ignored.
            const results = await eslint.lintFiles(["brackets/*.js"]);

            assert.strictEqual(results.length, 1);
            assert.strictEqual(results[0].filePath, getFixturePath("ignored-paths", "brackets", "index.js"));
        });

        it("should throw an error when all given files are ignored via ignore-pattern", async () => {
            eslint = new ESLint({
                useEslintrc: false,
                overrideConfig: {
                    ignorePatterns: "tests/fixtures/single-quoted.js"
                }
            });

            await assert.rejects(async () => {
                await eslint.lintFiles(["tests/fixtures/*-quoted.js"]);
            }, /All files matched by 'tests\/fixtures\/\*-quoted\.js' are ignored\./u);
        });

        it("should not throw an error when ignorePatterns is an empty array", async () => {
            eslint = new ESLint({
                useEslintrc: false,
                overrideConfig: {
                    ignorePatterns: []
                }
            });

            await assert.doesNotReject(async () => {
                await eslint.lintFiles(["*.js"]);
            });
        });

        it("should return a warning when an explicitly given file is ignored", async () => {
            eslint = new ESLint({
                ignorePath: getFixturePath(".eslintignore"),
                cwd: getFixturePath()
            });
            const filePath = getFixturePath("passing.js");
            const results = await eslint.lintFiles([filePath]);

            assert.strictEqual(results.length, 1);
            assert.strictEqual(results[0].filePath, filePath);
            assert.strictEqual(results[0].messages[0].severity, 1);
            assert.strictEqual(results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
            assert.strictEqual(results[0].errorCount, 0);
            assert.strictEqual(results[0].warningCount, 1);
            assert.strictEqual(results[0].fatalErrorCount, 0);
            assert.strictEqual(results[0].fixableErrorCount, 0);
            assert.strictEqual(results[0].fixableWarningCount, 0);
        });