Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/analysis/src/jsts/rules/helpers/testing/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type estree from 'estree';
import { isIdentifier } from '../ast.js';
import ts from 'typescript';

const ASSERTION_METHODS = ['should', 'and'];
const ASSERTION_METHODS = new Set(['should', 'and']);

/**
* Detects Cypress assertion calls on the global `cy` chain, e.g.:
Expand Down Expand Up @@ -48,7 +48,7 @@ export function isTSAssertion(node: ts.Node): boolean {
return false;
}
const member = call.expression as ts.PropertyAccessExpression;
if (!ASSERTION_METHODS.includes(member.name.text)) {
if (!ASSERTION_METHODS.has(member.name.text)) {
return false;
}
return tsChainStartsWithCy(member.expression);
Expand Down