Giter Site home page Giter Site logo

buses-9923's Introduction

This is a repo for a test assessment, it will be deleted after assessment.


UI Demo - (if resource was not loading correctly, try reload in browser with webkit engine)

CircleCI codefactor

This is a very small NodeJS CLI application. The comments are in JSDoc style, can be used to generate documentation easily. CircleCI is used as a service for continuous integration during development. esm here is used for ECMAScript module loading.

How to

Requirements

  • yarn
  • git

yarn is recommended(npm should work too, but it is not used during development)

Run the app

  1. git clone https://github.com/tim-hub/buses-9923
  2. cd buses-9923
  3. yarn
  4. yarn start r [file path] absolute or relative path are supported, commands must be separated by lines. for example yarn start r ./test/data/input/case1.bcmd
    • r stands for read, to read commands from a file, a file path is required here.
  5. The output in console will be 0,1,NORTH

About Input/Output

Input

  • Input, from a file which contains the commands, sample files are in test/data/input/, for example in case3.bcmd, commands are
PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT

All commands must be separated by new line. Currently there are 5 valid commands, MOVE, LEFT, RIGHT, REPORT and PLACE [x],[y],[direction], a proper PLACE command requires 3 parameters,

  • x and y which both are between 0 to 4, x,y stands for the position of bus will be parked.
  • direction which is NORTHor EAST or SOUTH or WEST

Output

  • Output, standard output (to console by default), samples files are in test/data/output/

If run the commands like the example above, the output will be

3,3,NORTH

Testing

Mocha and Chai are used as test framework ans assertion library.

  • yarn test will test all testing.
  • yarn test-cli will test functionality of cli only.

All testing cases in test/data/ will be used to test the app.

Sample Data

Sample data is included, which is stored at test/data/ folder. Fot the testing purpose, both input commands and expected output are stored in the folder (input and output). For example,

  • input/case1.bcmd is the file which includes commands to run
  • output/case1.bout is the relative file which contains the expected result.

References

buses-9923's People

Contributors

tim-hub 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.