Skip to content

jtart/simorgh

 
 

Simorgh

Build Status Test Coverage Known Vulnerabilities Greenkeeper badge Maintainability

Installation

Install Node 8. https://nodejs.org/en/ Update to use the latest npm npm i -g npm

git clone git@github.com:bbc/simorgh.git
npm install

Local Development

To run this application locally, with hot-reloading, run: npm run dev.

The application will start on http://localhost:7080/. These is a single route, /.

Storybook (UI Development Environment/Style Guide)

To run locally npm run storybook, it will then be available at http://localhost:9001/. Introduction to and documentation for Storybook is here: https://storybook.js.org/basics/introduction/.

Production build

To run this application locally with a production build, run: npm run build && npm run start

Tests

Linting and unit tests

We have linting with the Airbnb styleguide and we use Prettier as a code formatter. They can be run with npm run test:lint.

We have Jest unit tests that can be run with npm run test:unit.

npm test runs both sets of these.

End-to-end tests

Main application

We use Cypress for our end-to-end tests. For running the tests locally, run this single command:

npm run test:e2e

It will spin up a production server on port 7080 and run the Cypress tests against that.

Further details on using the Cypress CLI can be found at https://docs.cypress.io/guides/guides/command-line.html

Cypress can be run interactively using npm run test:e2e:interactive. This loads a user interface which easily allows for indivdual tests to be run alongside a visual stream of the browser, as the tests run.

Storybook

We also have a Cypress project which runs a different set of end-to-end tests on Storybook. For running the tests locally we need two terminals running:

  1. npm run storybook with the application,
  2. npm run test:storybook with the Cypress integration tests.

Lighthouse Best Practice tests

We use Lighthouse to test the performance of our page. For running the tests locally we need two terminals running:

  1. Start the production server
  2. npm run lighthouse runs our Lighthouse tests.

Lighthouse will output html reports to the reports folder. It will also open a HTML report in your browser allowing an individual to clearly see the best practice score of the page along with the audits that were run against it.

About

The BBC's new article (soon... we hope)

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%