The purpose of this project is to easily test if a change to the appsettings response would break FE's validation.
You just create some example appsettings json-files, point this validator at them and it will say which work and which don't. To see examples, see folder example-input.
Or you point it at your configuration endpoint like https://localhost:5000/configuration
npm run fetch actually downloads the validation files from pp-fe repo and puts them into the project
I assume you have
- Node >16
- npm
- access to github fe repo
First time:
npm install
npm run fetch
npm start ARGNot first time:
npm run fetch
npm start ARGor
npm run fetch-start ARGIf you don't need latest version of stuff, just
npm start ARGnpm start (and npm run fetch-start) requires 1 argument, that argument is a file path to either
- a file, then the test is ran against that file
- a directory, then the test is ran against all json files in that directory (not recursive at the moment but easy to fix if that is desirable)
- a url, then it tries to fetch from that repo
- qa. tests all qa
- prod: tests all prod
- all: tests both prod and qa
ex:
npm start example-inputwill run test on
- example-input/app-settings-invalid.json
- example-input/app-settings.json
npm start example-input/app-settings.jsonwill run test on just
- example-input/app-settings.json
npm start http://localhost:5000/configurationwill call that endpoint (GET) and run the test on the response there is an example server you can start in parallell, it accepts a port but assumes 5000 if not given
npm run mock-server PORT
npm start http://localhost:5000/configurationThis line does it all (switch out example-input to your folder)
npm install && npm run fetch-and-start example-inputPrerequisites:
npm install
npm run fetchThen just run
npm test- Let oskar know if this might be useful
- If you are trying to go for prod or qa environments, you need to use vpn or have whitelisted IP
- JSON is pronounced J'son 🇫🇷