{"size": 865, "ext": "js", "max_stars_repo_path": "tests/lib/rules/no-weakrefs.js", "max_stars_repo_name": "sosukesuzuki/eslint-plugin-es-x", "max_stars_repo_stars_event_min_datetime": "2018-04-02T06:13:46.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-15T18:07:16.000Z", "max_issues_repo_path": "tests/lib/rules/no-weakrefs.js", "max_issues_repo_name": "sosukesuzuki/eslint-plugin-es-x", "max_issues_repo_issues_event_min_datetime": "2018-04-04T01:06:05.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-12T05:41:00.000Z", "max_forks_repo_path": "tests/lib/rules/no-weakrefs.js", "max_forks_repo_name": "sosukesuzuki/eslint-plugin-es-x", "max_forks_repo_forks_event_min_datetime": "2018-04-03T08:40:49.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-26T09:06:03.000Z"}
{"max_stars_count": 85, "max_issues_count": 58, "max_forks_count": 20, "avg_line_length": 27.9032258065, "max_line_length": 74, "alphanum_fraction": 0.5271676301}
/**
 * @author Yosuke Ota
 * See LICENSE file in root directory for full license.
 */
"use strict"

const RuleTester = require("../../tester")
const rule = require("../../../lib/rules/no-weakrefs.js")

new RuleTester().run("no-weakrefs", rule, {
    valid: ["Array", "Object", "let WeakRef = 0; WeakRef"],
    invalid: [
        {
            code: "WeakRef",
            errors: ["ES2021 'WeakRef' class is forbidden."],
        },
        {
            code: "function f() { WeakRef }",
            errors: ["ES2021 'WeakRef' class is forbidden."],
        },
        {
            code: "FinalizationRegistry",
            errors: ["ES2021 'FinalizationRegistry' class is forbidden."],
        },
        {
            code: "function f() { FinalizationRegistry }",
            errors: ["ES2021 'FinalizationRegistry' class is forbidden."],
        },
    ],
})
