Coder Social home page Coder Social logo

weatherapi's Introduction

Sunrays Interview Test

  • Node JS

server api

To run the code in your development environment:

  1. Download and unpack
  2. Run npm install
  3. Start the development server for seed project with npm run start
  4. Point your browser to http://localhost:3000
  5. Some test urls -: correct_city = http://localhost:3000/city/?name=london incorrect_city = http://localhost:3000/city/?name=nowhere specific_metrics = http://localhost:3000/short/?name=london&duration=6&metrics=weather_state_name&metrics=weather_state_abbr weather_test_farenheit = http://localhost:3000/short/?name=london&duration=6&temperature_format=F weather_test_celcius = http://localhost:3000/short/?name=london&duration=6&temperature_format=C speed_test_M = http://localhost:3000/short/?name=london&duration=6&wind_speed_format=M speed_test_K = http://localhost:3000/short/?name=london&duration=6&wind_speed_format=K short_call = http://localhost:3000/short/?name=london&duration=1&type=short length_test = http://localhost:3000/short/?name=london&duration=6

test

npm run test

This will run the cucumber tests and produce a reports json file in 'testing\reporting'


test-report

'npm run testreport'

This will display the output from the tests.

Notes -:

  1. I am not overly happy with the tests for the temperature and speed -I think that they could be improved by extending the API such that I get an historically known temperature and speed. Using that as a known value, then do the comparison. As it is the solution involves pulling in the conversion methods into the test which I wasn't overly happy with.

  2. I enjoyed the test - however I think it could be improved by showing some concrete examples of the response that are expected for a given request as I felt there was some abiguity - especially around the metrics.

  3. I couldn't remember how to configure Cucumber to look in to other directories for certain files so the top level directories are a little more polluted than I would like.

  4. Timing wise, the test took me about 4 nights of post work development to complete. I was familiar with most of the work required but I was rusty on BDD Cucumber and also the reporting although the reporting came together faster than I expected once I understood the steps required to set it up.

  5. To improve this test it would be good if there was some sort of pairing involved with someone from Sainsburys. In my experience a test tells you a small part about a developer and that a small pairing test with a developer reveals an awful lot more about them. For example at my first company - a Virtual Reality company in the 90's - we had a reverse array test that we did with the developer and we paired on it. It was incredibly enlightening as to whether or not the developer would be a good fit to the team but also it gave an insight into how they worked and their breadth and depth on knowlege. I could go on!!! :)

  6. I hope you like what you see and I'd welcome the chance to work at Sainsburys PLC


weatherapi's People

Watchers

Richard Hill 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.