- Start SonarQube via Docker
# in the folder with docker-compose.yml
docker-compose up -d
(wait until server successfully started)
- Access SonarQube and change default (admin/admin) password
- Run Jest with coverage enabled
jest --coverage --detectOpenHandles --forceExit
-
Tweak
sonar-project.properties
to match the correct paths -
Install SonarQube Scanner
npm install sonarqube-scanner
- Run SonarQube Scanner
node_modules/.bin/sonar-scanner -X
# -X is for debug, it can be omitted
- Navigate to SonarQube and observe new analysis