-
Notifications
You must be signed in to change notification settings - Fork 0
/
sonar-project.js
27 lines (25 loc) · 988 Bytes
/
sonar-project.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// eslint-disable-next-line import/no-extraneous-dependencies
const sonarqubeScanner = require('sonarqube-scanner');
const configs = require('./src/config/config');
const env = process.env.NODE_ENV || 'local';
const config = configs[env];
sonarqubeScanner(
{
serverUrl: 'https://sonar.codewalnut.com/',
token: config.sonarToken,
options: {
'sonar.sources': 'src',
'sonar.exclusions': '**/*.test.ts',
'sonar.inclusions': '**', // Entry point of your code
'sonar.tests': 'tests',
'sonar.test.inclusions': 'tests/**/*.test.ts', // Test files
'sonar.javascript.lcov.reportPaths': 'coverage/lcov.info', // LCOV coverage file (you should generate this file with a test runner like Jest)
'sonar.projectKey': 'store-sap-backend',
'sonar.projectName': 'store-sap-backend',
'sonar.organization': 'codewalnut',
'sonar.projectVersion': '1.0.0',
'sonar.token': config.sonarToken,
},
},
() => process.exit(),
);