menu

Testing Library

Simple and complete DOM testing utilities that encourage good testing practices.

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# General Help
view-forward
# Angular Help
view-forward
# Cypress Help
view-forward
# DOM Help
view-forward
# React Help
view-forward
# TestCafe Help
view-forward
# Vue Help
view-forward
Team

How can I test if methods in the onDestroy() are being called?

January 21, 2020 at 3:23pm

How can I test if methods in the onDestroy() are being called?

January 21, 2020 at 3:23pm
I'm currently working on a project that uses Web-sockets, it's very important that I can verify that the socket connection is being closed in the onDestroy() of my component. But I can't find how to unmount a test-render? Does anyone have some experience or ideas on how this could be achieved?

January 22, 2020 at 7:49am
Found the solution. I was able to unmount the component using fixture as explained here: https://testing-library.com/docs/angular-testing-library/api#fixture
  • reply
  • like