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

Code before:
                const filePaths = (await engine.lintFiles("**/*.js"))
                    .map(r => r.filePath)
                    .sort();

                assert.deepStrictEqual(filePaths, [
                    path.join(root, "eslint.config.js"),
                    path.join(root, "foo.js"),
                    path.join(root, "node_modules/foo/index.js")
                ]);
            });
        });

        xdescribe("ignore pattern can re-ignore files that are unignored by a previous pattern.", () => {
            const { prepare, cleanup, getPath } = createCustomTeardown({
                cwd: root,
                files: {
                    "eslint.config.js": `module.exports = ${JSON.stringify({
                        ignores: ["!.*", ".foo*"]
                    })}`,
                    ".foo.js": "",
                    ".bar.js": ""
                }
            });

            beforeEach(prepare);
            afterEach(cleanup);

            it("'isPathIgnored()' should return 'true' for re-ignored '.foo.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });

                assert.strictEqual(await engine.isPathIgnored(".foo.js"), true);
            });

            it("'isPathIgnored()' should return 'false' for unignored '.bar.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });

                assert.strictEqual(await engine.isPathIgnored(".bar.js"), false);
            });

            it("'lintFiles()' should not lint re-ignored '.foo.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });
                const filePaths = (await engine.lintFiles("**/*.js"))
                    .map(r => r.filePath)
                    .sort();

                assert.deepStrictEqual(filePaths, [
                    path.join(root, ".bar.js"),
                    path.join(root, "eslint.config.js")
                ]);
            });
        });

Review comment (suggestion):
```suggestion
            it("'isPathIgnored()' should return 'false' for 'node_modules/foo/index.js'.", async () => {
```

Test title doesn't match the assertion in the test.

The assertion is correct. `node_modules/foo/` is ignored by default, but since `**/node_modules/foo/**` now matches `node_modules/foo/`, `!**/node_modules/foo/**` will unignore it, so the files inside are not ignored.

Code after:
                    path.join(getPath(), "foo.js"),
                    path.join(getPath(), "node_modules/foo/.dot.js"),
                    path.join(getPath(), "node_modules/foo/index.js")
                ]);
            });
        });

        describe("ignores can unignore '/node_modules/foo/**'.", () => {

            const { prepare, cleanup, getPath } = createCustomTeardown({
                cwd: `${root}-unignores`,
                files: {
                    "eslint.config.js": `module.exports = {
                        ignores: ["!**/node_modules/foo/**"]
                    };`,
                    "node_modules/foo/index.js": "",
                    "node_modules/foo/.dot.js": "",
                    "node_modules/bar/index.js": "",
                    "foo.js": ""
                }
            });

            beforeEach(prepare);
            afterEach(cleanup);

            it("'isPathIgnored()' should return 'true' for 'node_modules/foo/index.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });

                assert.strictEqual(await engine.isPathIgnored("node_modules/foo/index.js"), false);
            });

            it("'isPathIgnored()' should return 'true' for 'node_modules/foo/.dot.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });

                assert.strictEqual(await engine.isPathIgnored("node_modules/foo/.dot.js"), false);
            });

            it("'isPathIgnored()' should return 'true' for 'node_modules/bar/index.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });

                assert.strictEqual(await engine.isPathIgnored("node_modules/bar/index.js"), true);
            });

            it("'lintFiles()' should verify 'node_modules/foo/index.js'.", async () => {
                const engine = new FlatESLint({ cwd: getPath() });
                const result = (await engine.lintFiles("**/*.js"));

                const filePaths = result
                    .map(r => r.filePath)
                    .sort();