-
Notifications
You must be signed in to change notification settings - Fork 1
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
add tests for heartbit react #61
Conversation
Joshua-onwuzu
commented
Apr 8, 2024
- Bug fix
- New feature
- Chore
- Breaking change
- There is an open issue which this change addresses
- My commits follow the Git Commit Guidelines
- My code follows the code style of this project.
- My change requires a change to the documentation.
- I have updated the documentation accordingly.
- My change requires a change to Typescript typings.
- I have updated the typings accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
import { render } from '@testing-library/react'; | ||
import { HeartBitContext, HeartBitProvider, IHeartBitContext } from './components'; | ||
import { describe, expect, jest, it } from '@jest/globals'; | ||
import HeartBitCore from '@fileverse/heartbit-core'; // Adjust the import path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong import
const context = React.useContext(HeartBitContext); | ||
|
||
useEffect(() => { | ||
context?.[contextFunction](args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different functions have different args this will not run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM