codecharta icon indicating copy to clipboard operation
codecharta copied to clipboard

Unhandled Promise in tests

Open shaman-apprentice opened this issue 3 years ago • 1 comments

Bug

As a developer I want tests to be easy to reason about and to have only deterministic effects.

codeCharta.component.ts currently starts a Promise in its constructor. This Promise is not awaited in its tests. That makes it hard to reason about the tests and leads to potential non deterministic tests.

E.g. Angular uses zone.js. When introducing jest-preset-angular for it, async stuff is mocked, leading to a test failure.

At the latest when migrating this component, we should redesign the tests and maybe also the component.

shaman-apprentice avatar Jul 12 '21 19:07 shaman-apprentice

Relates to #2284

shaman-apprentice avatar Jul 12 '21 19:07 shaman-apprentice