-
Notifications
You must be signed in to change notification settings - Fork 0
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
Write unit tests for existing classes #94
Comments
Depending on the code, I may modify implementations to use dependency injections, so we can mock dependencies using jest. |
Very seamless to use. This is the code for one test, and it's very straightforward to use. test('getOrderedConcepts contains only concepts in ConceptAbbreviations', () => {
const concepts = wrapper.instance().getOrderedConcepts();
concepts.forEach((concept) => {
expect(g[concept.name] !== undefined).toBe(true);
});
}); |
Added a CSS proxy because tests were crashing when trying to import objects with a CSS import at the top. |
Wrote guide a couple days ago for writing unit tests with Enzyme https://github.com/codeandcognition/koconut/blob/summer2018-master/docs/jest.md |
Fix existing unit tests with new router change |
test suite exists in src/tests, but they're out of date and incomplete |
I have been looking into writing unit tests for React components.
It's done using a library called Enzyme, created by Airbnb (http://airbnb.io/enzyme/).
I'll start writing a few tests. I've never really wrote any unit tests before, so this'll be new. I'm sure it'll be very useful in the future for expansion.
The text was updated successfully, but these errors were encountered: