Giter VIP home page Giter VIP logo

empatica-assignment's Introduction

Empatica assignment

Project for the coding assignment.

Getting Started

The project contains both the fake backend and the frontend. I pushed the backend because I needed to tweak it a bit in order to make it return appropriate CORS headers without whom I couldn't make requests from a frontend running on another port. I also slightly slowed down artificially some of the endpoints, to demonstrate how the loading spinner works.

Backend

  • Move to folder backend.
  • Install the dependencies with npm install.
  • Run the server with npm start if you are in the backend folder, or with npm run start-backend if you are in the project root. The server binds by default to port 3000.

Frontend

  • Install the dependencies with npm install.
  • Run the frontend server with npm start. The server binds by default to port 8000.

Build

The provided gulpfile contains the build configuration to generate a distributable version of the app. More details can be found directly within the build script.

To build the app run npm run build. A dist folder will be generated with all the required files.

To run a frontend server that exposes the build app, use npm run start-dist. The server binds by default to port 8001.

Testing

Unit tests

The unit tests are found next to the code they are testing and have a .spec.js suffix (e.g. spinner.spec.js).

If you previously ran npm install, all the required dependencies will be already available.

To start Karma and run the full test suite run npm test.

End-to-End tests

End-to-End tests can be found under e2e-tests. If you previously ran npm install, all the required dependencies will be already available.

To start Protractor and run the full test suite:

  • Install the webdriver with npm run update-webdriver.
  • Ensure both the frontend and the backend servers are up and running.
  • Run npm run protractor.

Note: Under the hood, Protractor uses the Selenium Standalone Server, which in turn requires the Java JDK to be installed on your local machine.

Note: I have deliberately written some of the test cases assuming this is a demo frontend project backed by a dummy server. For example, orders get cancelled but never created, which would breaks tests idempotency if the orders were really deleted.

empatica-assignment's People

Contributors

luca-poddigue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.