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

Code before:
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath(".."),
                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
                overrideConfigFile: getFixturePath("eslint.config.js")
            });
            const results = await eslint.lintFiles(["fixtures/files/"]);

            assert.strictEqual(results.length, 2);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[1].messages.length, 0);
            assert.strictEqual(results[0].suppressedMessages.length, 0);
        });

        // https://github.com/eslint/eslint/issues/16413
        it("should find files and report zero messages when given a parent directory with a .js", async () => {
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath("example-app/subdir")
            });
            const results = await eslint.lintFiles(["../*.js"]);

            assert.strictEqual(results.length, 2);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[0].suppressedMessages.length, 0);
            assert.strictEqual(results[1].messages.length, 0);
            assert.strictEqual(results[1].suppressedMessages.length, 0);
        });

        // https://github.com/eslint/eslint/issues/16038
        it("should allow files patterns with '..' inside", async () => {
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath("dots-in-files")
            });
            const results = await eslint.lintFiles(["."]);

            assert.strictEqual(results.length, 2);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[0].filePath, getFixturePath("dots-in-files/a..b.js"));
            assert.strictEqual(results[0].suppressedMessages.length, 0);
        });


        // https://github.com/eslint/eslint/issues/16299
        it("should only find files in the subdir1 directory when given a directory name", async () => {
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath("example-app2")
            });
            const results = await eslint.lintFiles(["subdir1"]);

Review comment (suggestion):
`fixtures/files` actually has a dot file in it. Because this directory is also used for `cli-engine` tests, I didn't want to change the directory itself. So I just updated the results.

The same is true for a few other tests as well.

Code after:

        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")]);

            assert.strictEqual(results.length, 1);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[0].suppressedMessages.length, 0);
        });

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

            assert.strictEqual(results.length, 3);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[1].messages.length, 0);
            assert.strictEqual(results[0].suppressedMessages.length, 0);
        });

        // https://github.com/eslint/eslint/issues/16413
        it("should find files and report zero messages when given a parent directory with a .js", async () => {
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath("example-app/subdir")
            });
            const results = await eslint.lintFiles(["../*.js"]);

            assert.strictEqual(results.length, 2);
            assert.strictEqual(results[0].messages.length, 0);
            assert.strictEqual(results[0].suppressedMessages.length, 0);
            assert.strictEqual(results[1].messages.length, 0);
            assert.strictEqual(results[1].suppressedMessages.length, 0);
        });

        // https://github.com/eslint/eslint/issues/16038
        it("should allow files patterns with '..' inside", async () => {
            eslint = new FlatESLint({
                ignore: false,
                cwd: getFixturePath("dots-in-files")