How to use the react-testing-library.cleanup function in react-testing-library

To help you get started, we’ve selected a few react-testing-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / ionic / react / src / components / utils / controller-test-utils.ts View on Github external
function cleanupAfterController() {
    const controller = document.querySelector(controllerTag);
    if (controller) {
      controller.remove();
    }
    const element = document.querySelector(elementTag);
    if (element) {
      element.remove();
    }
    cleanup();
  }