Renders the App
component, wraps App
component and all preceeding components in MyContext.Provider
component to allow state access. index.js
App component rendered via root
on index.html
.
Renders the Counter
, Incrementer
, and Decrementer
components.
Subscribes to MyContext
as a consumer to access state. Renders the current state of count.
Subscribes to MyContext
as a consumer to access state. Renders button that changes state of count +1 onClick
.
Subscribes to MyContext
as a consumer to access state. Renders button that changes state of count -1 onClick
.
- None.
npm start
- To run tests use the command
npm test
ornpm test component.test.js
. - Assertions made:
componenets.test.js
: Do the components exist, do they render what is expected?- Does state change on
increment.js
anddecrement.js
components when button is clicked?