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

Code before:
            });
            await assert.rejects(() => eslint.lintFiles("fixtures/undef*.js"), /Could not find config file/u);
        });

        it("should not throw if eslint.config.js file is not present and overrideConfigFile is `true`", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(".."),
                overrideConfigFile: true
            });
            await eslint.lintFiles("fixtures/undef*.js");
        });

        it("should not throw if eslint.config.js file is not present and overrideConfigFile is path to a config file", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(".."),
                overrideConfigFile: "fixtures/configurations/quotes-error.js"
            });
            await eslint.lintFiles("fixtures/undef*.js");
        });

        it("should throw if overrideConfigFile is path to a file that doesn't exist", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(),
                overrideConfigFile: "does-not-exist.js"
            });
            await assert.rejects(() => eslint.lintFiles("undef*.js"));
        });

        it("should throw an error when given a config file and a valid file and invalid parser", async () => {
            eslint = new FlatESLint({
                overrideConfig: {
                    languageOptions: {
                        parser: "test11"
                    }
                },
                overrideConfigFile: true
            });

            await assert.rejects(async () => await eslint.lintFiles(["lib/cli.js"]), /Expected object with parse\(\) or parseForESLint\(\) method/u);
        });

        it("should report zero messages when given a directory with a .js2 file", async () => {
            eslint = new FlatESLint({
                cwd: path.join(fixtureDir, ".."),
                overrideConfigFile: getFixturePath("eslint.config.js"),
                overrideConfig: {
                    files: ["**/*.js2"]
                }
            });
            const results = await eslint.lintFiles([getFixturePath("files/foo.js2")]);


Review comment (suggestion):
Same, do we want to check the message?

```suggestion
            await assert.rejects(() => eslint.lintFiles("undef*.js"), /Could not find config file/u);
```

Code after:
            });
            await assert.rejects(() => eslint.lintFiles("fixtures/undef*.js"), /Could not find config file/u);
        });

        it("should not throw if eslint.config.js file is not present and overrideConfigFile is `true`", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(".."),
                overrideConfigFile: true
            });
            await eslint.lintFiles("fixtures/undef*.js");
        });

        it("should not throw if eslint.config.js file is not present and overrideConfigFile is path to a config file", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(".."),
                overrideConfigFile: "fixtures/configurations/quotes-error.js"
            });
            await eslint.lintFiles("fixtures/undef*.js");
        });

        it("should throw if overrideConfigFile is path to a file that doesn't exist", async () => {
            eslint = new FlatESLint({
                cwd: getFixturePath(),
                overrideConfigFile: "does-not-exist.js"
            });
            await assert.rejects(() => eslint.lintFiles("undef*.js"), { code: "ENOENT" });
        });

        it("should throw an error when given a config file and a valid file and invalid parser", async () => {
            eslint = new FlatESLint({
                overrideConfig: {
                    languageOptions: {
                        parser: "test11"
                    }
                },
                overrideConfigFile: true
            });

            await assert.rejects(async () => await eslint.lintFiles(["lib/cli.js"]), /Expected object with parse\(\) or parseForESLint\(\) method/u);
        });

        it("should report zero messages when given a directory with a .js2 file", async () => {
            eslint = new FlatESLint({
                cwd: path.join(fixtureDir, ".."),
                overrideConfigFile: getFixturePath("eslint.config.js"),
                overrideConfig: {
                    files: ["**/*.js2"]
                }
            });
            const results = await eslint.lintFiles([getFixturePath("files/foo.js2")]);