To format the code, just run the command npm run format
at the root source folder, which would also fix the formatting errors. If instead you would like to only view the formatting problems then run npm run format:check
. Formatting rules are defined inside .prettierrc. Files that are excluded from formatting are defined inside .prettierignore.
To run a static check on the code, run npm run lint
at the root source folder. Lint rules are defined inside .eslintrc, and .eslintignore defines the files that are excluded from linting.
To run the tests use the command npm run test
at the root source folder. Testing code is inside the tests folder. Below is a list of files inside that folder, and the functionality they test.
- data-store.test.ts: Tests data store functionality.
- event-bus.test.ts: Tests event bus functionality.
- format.test.ts: Tests formatting utility functions.
- identicon.test.ts: Tests Polkadot identicon generator code.
- object.test.ts: Tests deep cloning code for single objects and arrays.
- rpc-subscription-service.test.ts: Tests the generic RPC subscription service class functionality, which is used for connecting to SubVT WebSocket services.
- ui-util.test.ts: Test validator display text generator function.