/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/regexLookbehind.test.ts
27 строк
850 B
Michael Naumov
test: add names to each test
16 апр 2026, 21:21
16 апр 2026, 21:21
86a5720
Код
Авторство
О чём код?
import { RuleTester } from "@typescript-eslint/rule-tester"; import regexLookbehindRule from "../lib/rules/regexLookbehind.js"; const ruleTester = new RuleTester(); ruleTester.run("regex-lookbehind", regexLookbehindRule, { valid: [ { name: "regex without lookbehind is allowed", code: "const re = /foo/;", options: [{ isDesktopOnly: false }], }, { name: "lookbehind in desktop-only mode is allowed", code: "const re = /(?<=foo)bar/;", options: [{ isDesktopOnly: true }], }, ], invalid: [ { name: "lookbehind in non-desktop mode is forbidden", code: "const re = /(?<=foo)bar/;", options: [{ isDesktopOnly: false }], errors: [{ messageId: "lookbehind" }], }, ], });