Skip to content

Commit

Permalink
chore: sonar exclusions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosemaPereira authored Mar 28, 2024
1 parent 4e9e8c6 commit 9e8acfd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const config = {
lines: 90,
},
},
collectCoverageFrom: ['app/**/*.js', '!app/**/index.js'],
collectCoverageFrom: [
'app/**/*.js',
'!app/internal/**/index.js',
'!app/index.js',
],
setupFiles: ['<rootDir>/test/setEnvVars.js'],
testResultsProcessor: 'jest-sonar-reporter',
};
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonar.language=js
sonar.sources=app
sonar.tests=test

sonar.exclusions=test/*,node_modules/*, dist/*, coverage/*
sonar.exclusions=test/*,node_modules/*, dist/*, coverage/*, app/internal/**/index.js, app/index.js

sonar.test.inclusions=test/**/*.test.js
sonar.coverage.exclusions=node_modules/*, dist/*, coverage/*
Expand Down
9 changes: 9 additions & 0 deletions test/integration/server/server.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import request from 'supertest';
import App from '../../../app/server';

describe('Express App', () => {
it('responds with CORS headers', async () => {
const response = await request(App).get('/');
expect(response.headers['access-control-allow-origin']).toBe('*');
});
});

0 comments on commit 9e8acfd

Please sign in to comment.