UNPKG

eslint-plugin-ui-testing

Version:

ESLint rules for UI testing tools WebdriverIO, Cypress, TestCafe, Playwright, Puppeteer

31 lines (30 loc) 968 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RULE_NAME = void 0; var utils_1 = require("../utils/utils"); exports.RULE_NAME = __filename.slice(__dirname.length + 1, -3); exports.default = (0, utils_1.createRule)({ name: exports.RULE_NAME, meta: { docs: { description: 'Disallow implicit wait', recommended: 'error', }, messages: { noImplicitWait: 'Avoid implicit wait, use explicit wait instead', }, schema: [], type: 'problem', }, defaultOptions: [], create: function (context) { return { 'CallExpression[callee.object.name=/^(browser)$/][callee.property.name=/^(setTimeout)$/] Identifier[name=\'implicit\']': function rule(node) { context.report({ node: node, messageId: 'noImplicitWait', }); }, }; }, });