Skip to content

Twiage/ts-interview

Repository files navigation

eta-calculator

Estimate ETA for Twiage Cases

Getting started

Requirements

  1. Install nvm:

macOS or Ubuntu using bash

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

and then run

source ~/.bash_profile

or

source ~/.zshrc

and check if nvm is installed (v0.39.3)

nvm --version

In case you get a nvm command not found message, add the following lines in the end of your ~/.bash_profile or ~/.zshrc:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  1. Install Node 16:
nvm install 16 && nvm use 16

install yarn

with brew:

brew install yarn

with npm

npm install -g yarn

Testing

We are using Jest as a testing framework.

We put out tests at the same directory with testing code.

Naming conventions

__system-tests__ - directory name for system tests

__unit-tests__ - directory name for unit tests

Unit testing

WebStorm users can use run configuration.

Run unit tests

yarn test:unit

For mac users

You need to install watchman using brew

brew update && brew install watchman

System testing

WebStorm users can use run configuration

yarn test:system

Task

Make this lambda function handle individual location update.

  1. We have red unit test for getLocation function under MongoManager. Implement code so test is no longer red.

  2. distanceMatrixRequest method under distanceMatrixService is designed to use a special data structure. Refactor it so instead it takes 2 arguments: point A and point B

  3. Add all necessary tests and implement code to handle individual location update

Dependencies

To add prod dependency

yarn add {DEPENDENCY}

To add dev dependency (testing framework, build tool, assertion library linters etc)

yarn add -D {DEPENDENCY}

To remove dependency

yarn remove {DEPENDENCY}

About

TypeScript task for the interview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published