Code Monkey home page Code Monkey logo

javascripttest's Introduction

JavaScript test

In this exercise, you would get history of events from an e-commerce website using an API returning JSON that looks like the following mocked file: test/history-api-mock.json

We expect you to make unit tests from test/index.spec.js pass.

Install

Option 1: GitPod

Open this repository in GitPod.

Option 2: local machine

Install Node.js

Install Git

Create a GitHub account if you don't have one and fork this project (top right hand corner button).

Clone your fork to work on it on a local machine:

git clone https://github.com/<your-username>/JavaScriptTest
cd JavaScriptTest

Install dependencies: npm install

Develop

Modify/create files inside the src directory (you should not need to edit any other file to succeed).

Then fill the methods in src/analytics.js and add intermediate methods if it can help the readability of the code.

Test

You can test your code using npm test

You can debug your code using src/index.js and running npm start

Submit your solution

Create a ZIP or TAR archive with modified files (src directory should be enough for this test, but you can include package.json if you added packages).

On GitPod, you can right-click on the src folder and click "Download".

Then send us the archive by mail.

Evaluation

You should first try to get outputs of methods as close as possible to the values unit test expect.

We will take into consideration:

  • the clarity of your code: variables names, indentation, comments, commit messages;
  • the respect of best practices;
  • the optimization of the code: significant optimizations like caching results or reducing number of loops would be appreciated.

javascripttest's People

Contributors

julien9999 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.