/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/preferAbstractInputSuggest.test.ts
52 строки
2 KB
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 noDeprecatedSuggestRule from "../lib/rules/preferAbstractInputSuggest.js"; const ruleTester = new RuleTester(); ruleTester.run("no-deprecated-text-input-suggest", noDeprecatedSuggestRule, { valid: [ { name: "popperjs call without sameWidth modifier is allowed", code: ` import { createPopper } from '@popperjs/core'; createPopper(button, tooltip, { placement: 'top', }); `, }, { name: "popperjs call with other modifiers is allowed", code: ` import { createPopper } from '@popperjs/core'; createPopper(button, tooltip, { modifiers: [{ name: 'offset', options: { offset: [0, 8] } }], }); `, }, { name: "call to a different function is allowed", code: "someOtherFunction();", }, ], invalid: [ { name: "deprecated sameWidth modifier pattern is forbidden", code: ` import { createPopper } from '@popperjs/core'; createPopper(inputEl, suggestEl, { placement: "bottom-start", modifiers: [ { name: "sameWidth", enabled: true, fn: () => {}, phase: "beforeWrite", requires: ["computeStyles"], }, ], }); `, errors: [{ messageId: "preferAbstractInputSuggest" }], }, ], });