-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Task] Revamp unit test framework to isolate snapshot testing #661
Labels
Comments
Failed run: https://github.com/cryostatio/cryostat-web/actions/runs/3660946309/jobs/6188646168
There has been some flanky runs with this tests locally and in github Actions. Need to take a closer look. |
This was referenced Dec 14, 2022
$ yarn test -t '<NotificationControl/>' --verbose
console.warn
[mobx-react-lite] importing batchingForReactDom is no longer needed
at Object.<anonymous> (node_modules/mobx-react-lite/batchingForReactDom.js:2:13)
at Object.<anonymous> (node_modules/mobx-react/batchingForReactDom.js:1:83)
console.warn
[mobx-react-lite] importing batchingForReactDom is no longer needed
at Object.<anonymous> (node_modules/mobx-react-lite/batchingForReactDom.js:2:13)
at Object.<anonymous> (node_modules/mobx-react/batchingForReactDom.js:1:83)
console.error
Warning: It looks like you're using the wrong act() around your test interactions.
Be sure to use the matching version of act() corresponding to your renderer:
// for react-dom:
import {act} from 'react-dom/test-utils';
// ...
act(() => ...);
// for react-test-renderer:
import TestRenderer from 'react-test-renderer';
const {act} = TestRenderer;
// ...
act(() => ...);
in Component
at console.error (node_modules/@testing-library/react/dist/act-compat.js:55:34)
at printWarning (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:120:30)
at error (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:92:5)
at warnIfNotScopedWithMatchingAct (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13714:7)
at dispatchAction (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6404:9)
at ConsumerObserver.Object.<anonymous>.ConsumerObserver.next (node_modules/rxjs/src/internal/Subscriber.ts:161:25)
at SafeSubscriber.Object.<anonymous>.Subscriber._next (node_modules/rxjs/src/internal/ |
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #648
It appears sometimes that including snapshot testing in the same test suite with other tests causes some irregularities in test setup (i.e.
setState on unmounted component
, orTypeError: unable to read property from null (reading children
).To reproduce a simple example:
src/test/Recordings/Recordings.test.tsx
..mockReturnValueOnce(of(true))
as first call to.spyOn(defaultServices.api, 'isArchiveEnabled')
for mocking this service call.Though this could be due to how we mock modules. Need investigating.
The text was updated successfully, but these errors were encountered: