-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle skipped test correctly #24
Conversation
Pull Request Test Coverage Report for Build 140
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 140
💛 - Coveralls |
First of all, thank you for opening this PR. I was able to reproduce the error using this repo: https://github.com/gearsdigital/karma-sonarqube-reporter-issue-23 You really got it. The regex doesn't match mocha skipped tests:
By other hand, the original regex can deal with jasmine skipped tests:
Since not matching the initials Additionally, I downloaded your fix and I used it in your sample project. I noticed it's still not working as expected. This was the result produced: START:
helper
✔ should transform a string to uppercase letters
✖ should be skipped (skipped)
ERROR: Please, report issue => Test file path not found! {"src/test/helper.spec.js":{"describe":["helper"],"it":["should transform a string to uppercase letters"]}} | helper | should be skipped
Finished in 0.011 secs / 0 secs @ 23:12:53 GMT-0300 (Brasilia Standard Time)
SUMMARY:
✔ 1 test completed
ℹ 1 test skipped Steps to reproduce: # Create a folder
mkdir patches && cd patches
# Clone both repositories
git clone https://github.com/gearsdigital/karma-sonarqube-reporter.git
git clone https://github.com/gearsdigital/karma-sonarqube-reporter-issue-23.git
# Navigate to your fix
cd karma-sonarqube-reporter
# Install your fix
npm install
# Navigate to your sample project
cd ../karma-sonarqube-reporter-issue-23
# Remove karma-sonarqube-reporter dependency
sed -i '/"karma-sonarqube-reporter": "^1.2.5"/d' ./package.json
# Remove comment from skipped test
sed -i 's/\/\///g' ./src/test/helper.spec.js
# Install your sample project
npm install
# Add a link to your fix
npm link ../karma-sonarqube-reporter
# Run your tests
npm run test To solve this problem you can do two changes:
karma-sonarqube-reporter/lib/path-finder.js Lines 20 to 35 in 25d76db
Make theses changes: Line 28: replace Could you do that, please? Thank you! |
@fad I really appreciate your feedback but I think you forgot to checkout the branch which contains the fix. Your are testing against your master. # Create a folder
mkdir patches && cd patches
# Clone both repositories
git clone https://github.com/gearsdigital/karma-sonarqube-reporter.git
git clone https://github.com/gearsdigital/karma-sonarqube-reporter-issue-23.git
# Navigate to your fix
cd karma-sonarqube-reporter
# Install your fix
npm install
# Checkout branch containing the fix
git checkout fix-skipped-specs
# Navigate to your sample project
cd ../karma-sonarqube-reporter-issue-23
# Remove karma-sonarqube-reporter dependency
sed -i '/"karma-sonarqube-reporter": "^1.2.5"/d' ./package.json
# Remove comment from skipped test
sed -i 's/\/\///g' ./src/test/helper.spec.js
# Install your sample project
npm install
# Add a link to your fix
npm link ../karma-sonarqube-reporter
# Run your tests
npm run test |
Yes, I've made a mistake. Sorry about that. |
LGTM |
Awesome! Thank you very much for merging. |
This PR fixes #23.
I slightly changed the regular expression to match skipped test cases and suites too.
describe.skip
describe.only
fdescribe
xdescribe
it.skip
it.only
fit
xit
This regex will match things like describe.lorem or describeLore() too. I guess this shouldn't be a problem because Jasmine or Mocha won't execute it either.
You can see it in action here: https://regex101.com/r/HUyh3u/1 and find a more detailed explanation here: #23 (comment)