Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Conversation

daelynj
Copy link

@daelynj daelynj commented Nov 29, 2019

Enzyme allows you to test react components with dom support. This will
allow us to mount components and test things such as user input,
components being rendered, and will also allow us to mock API calls in
tests in the future.

Using the Enzyme adapter as well, we will be able to stub out data
and create mocks.

Enzyme allows you to test react components with dom support. This will
allow us to mount components and test things such as user input,
componenets being rendered, and will also allow us to mock API calls in
tests in the future.
These lines allow us to use snapshot testing and a setup file for
Enzyme imports. The reason we want to do this is so that we abstract
some of the copy paste imports we will have to perform for every test.
This abstraction simply allows every test to access Enzyme without
having to copy paste the imports and router declaration every time.
Tests will still explicitly need to import the Enzyme functions they
want to use such as mount and shallow.
@daelynj
Copy link
Author

daelynj commented Nov 29, 2019

Block merging until PR #37 is merged, then a rebase needs to be performed to change the parent of this branch to master.

npm i -D @types/enzyme-adapter-react-16

This package contains type definitions for enzyme-adapter-react-16 that
we need if we want to fully test our components, ie. set up an adapter
for mocks.
@daelynj daelynj force-pushed the daelyn@enzyme branch 2 times, most recently from 928dbb0 to 58c5980 Compare December 12, 2019 23:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants