typescript and jest demo project
the project was setup using the following commands
npm init -y
npm install -D typescript jest ts-jest @types/jest
npx tsc --init
npx ts-jest config:init
allowing for subsequent setup by
npm install
npm run build
npm test
ts-node --files
> import { Controller } from "./src/chart"
The core of the problem is storing datapoints and calculating peroids to render. I approached this in a test first manner by translating the examples into jest mock expectations and using the specifications of resolution to test a function that is responsible for that.
Due to time contraints I chose to use TypeScript and leverage the provided code. Once I was able to setup a test environment using generated configs I proceeded to develop a minimal solution satisfying the tests.