Giter Club home page Giter Club logo

ministryofjustice.prepare-a-case's Introduction

Prepare a case

CircleCI

Prepare a case is a service that allows probation staff to prepare court cases.

Prerequisities

Before you begin, ensure you have met the following requirements:

  • You have Node.js LTS (Fermium) >= v14.16.1

For code quality the project adheres to JavaScript Standard Style which requires minimal configuration of your chosen IDE.

Unit tests use Jest.

Integration tests use Cypress and employ Gherkin features, integration tests also check for accessibility violations with Axe.

To use Prepare a case, follow these steps:

Install dependencies using

npm i

And then, to build the assets and start the app with (substituting in a valid client secret for the dev environment)

env API_CLIENT_SECRET={client-secret} COURT_CASE_SERVICE_URL=http://court-case-service-dev.apps.live-1.cloud-platform.service.justice.gov.uk NOMIS_AUTH_URL=https://sign-in-dev.hmpps.service.justice.gov.uk/auth npm run start

Or to use alongside a local instance of court-case-service

env COURT_CASE_SERVICE_URL=http://127.0.0.1:8080 npm run start

For development, there are additional tasks:

Start app with mocked backend

If unspecified, the app will use your local court-case-service app but you can also use WireMock.

Start the standalone WireMock server

java -jar wiremock-standalone-2.27.2.jar --global-response-templating --port 9091

And then, to build assets and start app with

`npm run start:watch

This will watch for changes in the application JavaScript and Nunjucks templates and automatically restart as required.

This will also ensure that the application does not restart due to changes to test scripts.

Run linter

npm run lint

Run unit tests

npm run unit-test

Run integration tests

For local running, start redis instance by:

docker-compose -f docker-compose.test.yml up

Start the standalone WireMock server

java -jar wiremock-standalone-2.27.2.jar --global-response-templating --port 9091

Then run the server in test mode by:

npm run start-feature` (or `npm run start-feature:dev` to run with nodemon)

Then run the integration tests:

npm run int-test

Or run the integration tests with the Cypress UI:

npm run int-test:ui

N.B. If your tests fail at cy.task('getLoginUrl').then(cy.visit) try restarting your standalone WireMock server

Environment variables

Court case service

Default: http://127.0.0.1:9091

Specify the court-case-service URL with COURT_CASE_SERVICE_URL

Cases per page

Default: 20

Specify the number of cases to display, per page with CASES_PER_PAGE

HMPPS User Preferences service

Default: http://127.0.0.1:9091

Specify the hmpps-user-preferences URL with USER_PREFERENCE_SERVICE_URL

Dependencies

  • hmpps-auth - for authentication
  • redis - session store and token caching

ministryofjustice.prepare-a-case's People

Contributors

chris-faulkner-mojdt avatar dependabot[bot] avatar jhevans avatar katie-cawthorne avatar markberridge avatar robinsillem avatar sarahyjja avatar snyk-bot avatar thedustroom avatar tomsmyers 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.