Git Product home page Git Product logo

bbc-academy-codesample's Introduction

Weather Cities

Summary

This application can be used to display a weather summary for a given city.

Installation

Use the Node Package Manager (npm) to install from github. On a BASH-like command line shell:

$ git clone [email protected]:bbc/bbc-academy-codesample.git
$ cd bbc-academy-codesample
$ npm install

Usage

Required: node version >= 4.3

$ node -v
  v4.3.0

Run script from the command line:

$ node scripts/run.js -c london
  {
    "title": "London, United Kingdom",
    "summary": "Heavy Rain, 7°C (45°F)"
  }

Testing

Use npm to run the tests, which are written using Mocha and TAP.

npm test

  > [email protected] test bbc-academy-codesample
  > mocha --reporter mocha-tap-reporter

  1..3
  ok 1 Weather City should return weather title and summary for a given city.
  ok 2 Weather City should return weather publication date for a given city. # SKIP -
  ok 3 Weather City should return weather summaries for all the cities. # SKIP -
  # tests 3
  # pass 1
  # fail 0
  # skip 2

Exercises

A: Running the application

  • Fork the apllication on github into your own github repository
  • Install the application onto a local machine which you have access to
  • Run the application and confirm that it works as you expect
  • Run the tests for the application and ensure that the # fail 0 result is shown (no failures)

B: Extend the application

  • Notice that the test folder contains several tests that are currently skipped.
  • Make changes to the code such that the test marked "TEST B" can run and pass.

C: Add a new feature to the application

  • Notice that the test folder contains several tests that are currently skipped.
  • Make further changes to the code such that the test marked "TEST C" can run and pass.

bbc-academy-codesample's People

Contributors

kerryns avatar micmath avatar

Watchers

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