Create a countdown timer with start/stop and reset buttons.
Fill in the methods for the Timer class found in src/timer.js.
Fill in the onReset
and onComplete
functions in src/index.js.
Add toggle functionality to the click event handler for the start/pause button in src/index.js.
Timer should:
- count down to 0 and stop.
- be able to pause and resume.
- Timer should stop counting down when paused
- Timer should continue counting from paused time when resumed.
- be able to reset
- when reset, the timer returns to it's initial start time.
Completion time: 1 - 2 hours
You can use Codesandbox or github to complete the challenge online or locally. Once you've completed the challenge, submit your work by sharing a link to your fork.
Fork https://codesandbox.io/s/github/kevinchappell/timer-challenge
Fork or clone this repo directly then run:
npm install
npm start
This will install its dependencies and start the development server. From there you can edit the files in src/
until the objectives are completed.
Describe testing strategy for the Timer class.
Add tests for the Timer class.