Skip to content

Commit

Permalink
Replace mocha and nyc with jest (#65)
Browse files Browse the repository at this point in the history
- update license
- now, license is replaced when using `npm run license-fix` (instead of prepended)
- Fixes https://github.com/SonarSource/sonar-scanner-npm/issues/64
- Rename `resources/` to `fixtures/` as per our new convention
  • Loading branch information
ilia-kebets-sonarsource authored Nov 2, 2023
1 parent f705d6c commit 5be28aa
Show file tree
Hide file tree
Showing 45 changed files with 10,926 additions and 5,881 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
"ignorePatterns": ["**/dist"],
rules: {
// notice
'notice/notice': ['error', { templateFile: 'scripts/file-header.ts' }],
'notice/notice': ['error', { templateFile: 'scripts/file-header.ts', onNonMatchingHeader: 'replace' }],
},
};
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
test-report.xml

# nyc test coverage
.nyc_output
Expand Down Expand Up @@ -131,7 +132,7 @@ xunit.xml

# End of https://www.gitignore.io/api/node,SonarQube,intellij+all

!test/**/resources/**/*
!test/**/fixtures/**/*

# MacOS
.DS_Store
6 changes: 0 additions & 6 deletions .nycrc.yml

This file was deleted.

32 changes: 32 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* sonar-scanner-npm
* Copyright (C) 2022-2023 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

module.exports = {
collectCoverageFrom: ['src/**/*.js'],
coverageReporters: ['lcov', 'text'],
coveragePathIgnorePatterns: ['.fixture.', '/fixtures/'],
moduleFileExtensions: ['js', 'ts', 'json'],
moduleDirectories: ['node_modules'],
testResultsProcessor: 'jest-sonar-reporter',
testMatch: [
'<rootDir>/test/unit/**/*.test.js'
],
testTimeout: 20000,
};
Loading

0 comments on commit 5be28aa

Please sign in to comment.