-
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
ERROR: Please, report issue => Test file path not found! {} | #23
Comments
Your Karma version seems to be very old. Did you add all the error output? It was expected more details have been outputted. Could you provide a sample project to reproduce this error? Thank you! |
I will try using a more recent version of karma, thank you :) :) |
Great! Let me know if it works with a newer Karma version. Meanwhile, I'll try to find out the minimal required version. I think I should have made it clear in the README instructions. |
Hello @fadc80 I changed karma version to "karma": "=4.0.0", but I have the same issue. :( |
Maybe you are not defining
Verify your |
The issue occurs every time when After some debugging I figured that the root cause lied within this regular expression: ((describe)|(it))\s*\(\s*((?<![\\])[\`\'\"])((?:.(?!(?<![\\])\4))*.?)\4 Walk through
ExplanationThe method As the regex doesn't match Therefore function testFile(paths, describe, it) {
var testFile = Object.keys(paths).find(path =>
exist(paths, path, describe, it));
if (testFile === undefined) {
logger.error('Test file path not found! %s | %s | %s',
JSON.stringify(paths), describe, it);
}
return testFile;
} Long story shortI fixed this issue in #24 by slightly changing the regular expression. It now matches:
All of this is afaik valid at least for Adapted regular expression((\S{0,2}describe?[^(]+)|(\s\S{0,2}it?[^(]+))\s*\(\s*((?<![\\])[`'"])((?:.(?!(?<![\\])\4))*.?)\4 You can see it in action here: https://regex101.com/r/HUyh3u/1 This regex will match things like |
Hello @gearsdigital , your fix seems good for me, I will try to modify on my local and let you in ;) Thanks. :) |
@helabenkhalfallah I wonder if you can confirm to have skipped tests on your setup. |
As I didn't have a sample project to reproduce it, I was just trying to guess what was wrong. I'm going to check your PR. Thank you. |
@fadc80 Do you need a sample project to verify? I can provide mine if you want... |
It would be good! 👍 |
@all-contributors please add @helabenkhalfallah as a contributor for bug. |
I've put up a pull request to add @helabenkhalfallah! 🎉 |
Hello, I have not skipped tests on my configuration :
I have only this and when I run : I use the version 1.3.0. Thank you so much for your help :) |
A test example :
|
@helabenkhalfallah Could you please try to delete the If this doesn't help please provide the |
Okay I will do this tomorrow and let you in ;) |
Hello, I deleted node modules, package lock and rerun but the same issue :
Karma config :
Package json :
|
@helabenkhalfallah I couldn't reproduce this error with the information you provided. Is this all the content you have in your karma-sonarqube-reporter/karma.conf.js Lines 1 to 43 in bcb3976
By the way, are you working with an Angular project? |
Same here. Wasn't able to reproduce it... It would be really helpful if you could provide a create a Minimal, Reproducible Example. |
@gearsdigital seem it fails if you use test data and string interpolation for test names in Jasmine. Spec: const expectedUrls = {
modern: 'test.com?fm=webp',
obsolete: 'test.com?fm=png&fl=png8',
};
const testData = [
{ browser: 'isChrome', url: 'test.com', expectedUrl: expectedUrls.modern },
{ browser: 'isIE', url: 'test.com', expectedUrl: expectedUrls.obsolete },
];
testData.forEach(({ browser, url, expectedUrl }) => {
it(`should return "${expectedUrl.split('?')[1]}" format for "${browser}"`, () => {
const browsers = {};
browsers[browser] = true;
fooService.getBrowsers.and.returnValue(browsers);
service = TestBed.get(BarService);
const actualUrl = service.getImageSrc({ url }, 'url');
expect(actualUrl).toBe(expectedUrl);
});
}); When running tests I get an error like: Parsed JSON shows: "src/app/services/bar.service.spec.ts": {
"describe": [
"BarService",
],
"it": [
"should return \"${expectedUrl.split('?')[1]}\" format for \"${browser}\""
]
}, |
@AKharytonchyk This problem seems to be the same discussed on #18 |
Hello,
When I run test I got :
ERROR: Please, report issue => Test file path not found! {} |
And the generated report is empty :
My Conf :
Thanks :)
The text was updated successfully, but these errors were encountered: