DVSA Driving Examiner Application
-
NodeJS - We are using n to manage our version. Please see
.nvmrcfor specific version -
NPM (If using n, your
npmversion will be automatically managed) -
Brew
-
Cocoapods (Recommend installing via Homebrew using
brew install cocoapods) -
Security
- Git secrets
- ScanRepo
- Unzip
repo-security-scanner_<version>_Darwin_<architercture>.tar.gzand rename the executable inside the folder toscanrepo- Add executable to path (usingecho $PATHto find your path)
- Unzip
-
NOTE: You wil need to obtain
ionic.config.jsonand.npmrcfiles containing secrets and save to the project root in order to build the app.
npm install(ornpm i)npm run build
Components, directives, and pipes use Angular's standalone default and declare their template dependencies
in their own imports. Import them directly rather than creating component NgModules.
Root routes are defined in src/app/app.routes.ts and registered with provideRouter() in src/main.ts,
alongside the application providers.
npm run config:devnpm run config:local
- For simulator/device (A list of devices will be displayed based on Xcode installations)
npm run serve:emulator
- For browser (Opens in default browser using data from
./mocks/generate-local-*.tsfiles)npm run serve:local
- Open ReduxDevTools
- In one terminal:
npm run remote-devtools-server - In another:
npm run serve:devtools - Open remote devtools from ReduxDevTools Chrome extension
- Open
settings(first use only) and set option forUse custom (local) server.Host name: localhost Port: 8000
The complete unit test suite runs with Vitest through Angular's @angular/build:unit-test
builder, using jsdom rather than a headless Chrome process.
npm run test
npm run test:reload
npm run test:fasttest and test:reload prepare mock data and the development environment first. test runs once with
coverage; test:reload watches for changes without coverage. test:fast skips coverage.
CI runs npm run test:fast command for brevity.
HTML, LCOV, and summary coverage reports are written to coverage/vitest.
To run tests without regenerating mock data or replacing the environment file:
npx ng test --watch=false --progress=false --coverage=falseStandalone tests must configure their own dependencies; application bootstrap providers are not inherited.
Use provideBasePageMocks() from mock/test-providers.ts for page dependencies, or
provideTestTranslations() for translation-only components. Configure a root store or provideMockStore()
separately, and include directives in standalone test host components' imports.
To run a single spec:
npx ng test --watch=false --coverage=false --include=src/store/journal/__tests__/journal.selector.spec.tsSpecs and shared mocks use native Vitest APIs. vi.spyOn() calls the original implementation
unless explicitly stubbed; use mockReturnValue, mockResolvedValue, or mockImplementation
when the real method must not run. Await asynchronous assertions, use firstValueFrom for
single observable emissions, and restore Vitest fake timers in finally blocks.
Angular 21's Zone-based fakeAsync, tick, and waitForAsync are not used in this suite.
Angular initializes TestBed automatically. src/test-setup.vitest.ts registers icons, browser
Buffer/global shims, IndexedDB emulation, and the existing detectChanges(false) default.
Tests run in isolated environments; mock cleanup and timeouts are configured in vitest.config.ts.
The runner uses a thread pool capped at eight workers (or the available CPU count on smaller
machines) to limit contention.
Translation tests load the real English/Welsh JSON through provideTestTranslations() in
mock/test-providers.ts, without HTTP requests.
Four legacy spec files containing only commented-out tests are explicitly excluded in
angular.json; no active tests are excluded. Existing skipped tests remain skipped.
In order to manually create a Sentry release, you should obtain the .sentryclirc file and place at root
- A script has been added (
buildScripts/sentry-deploy.sh) that will automatically create a new Sentry release and upload sourcemaps - If wishing to disable Sentry for any reason, then set the
dsnvalue to null in the env file
- This project uses husky to run a series of checks on
pre-commitandpre-push - This project uses
biometo enforce code styles/standards. Plugins are available for code editors such as webstorm and vscode
-
npm run lint
-
npm run lint:fix