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

Code before:
                    code: "var foo = 'bar'",
                    filename: "somefile.ts"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file name without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "somefile"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile.js"
                }
            ],
            invalid: []
        });
    });

    it("should keep allowing non-JavaScript files if the default config does not specify files", () => {
        FlatRuleTester.setDefaultConfig({ rules: {} });
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "somefile.ts"
                }
            ],
            invalid: []
        });
        FlatRuleTester.resetDefaultConfig();
    });

    it("should pass-through the options to the rule", () => {
        ruleTester.run("no-invalid-args", require("../../fixtures/testers/rule-tester/no-invalid-args"), {
            valid: [
                {
                    code: "var foo = 'bar'",

Review comment (bug):
This file path has an extension so the description seems wrong? While at this, it might be best to have two tests: `path/to/somefile.js` and `path/to/somefile`.

Code after:
                    code: "var foo = 'bar'",
                    filename: "somefile.ts"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "somefile"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path with extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile.js"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "src/somefile.ts"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "components/Component.vue"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile"
                },