Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await wait(() => {
const textContent = getNodeText(element);
if (textContent !== text) {
throw new Error(
`Text content not yet what is expected. Got: ${textContent}. Expecting: ${text}.`
);
} else {
expect(textContent).toBe(text);
}
});
};