We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Deno.statSync
Save the below file as test.ts:
test.ts
Deno.test("test", () => { Deno.statSync("."); });
And run the command deno test --coverage -A test.ts, then something like the following 2 json files are created:
deno test --coverage -A test.ts
{ "scriptId": "308", "url": "file:https:///path/to/test.ts", "functions": [ { "functionName": "", "ranges": [{ "startOffset": 0, "endOffset": 50, "count": 1 }], "isBlockCoverage": true }, { "functionName": "", "ranges": [{ "startOffset": 18, "endOffset": 47, "count": 1 }], "isBlockCoverage": true } ] }
{ "scriptId": "303", "url": "", "functions": [ { "functionName": "", "ranges": [{ "startOffset": 1, "endOffset": 1679, "count": 1 }], "isBlockCoverage": false } ] }
The second json file has empty url property and causes deno coverage command failure.
url
deno coverage
Notes:
Deno.stat
@std/fs
Version: Deno 1.43.6
The text was updated successfully, but these errors were encountered:
This happens because statSync internally use Function constructor and that part is caught as another script (with empty url).
statSync
Function
The below causes the same issue:
Deno.test("test", () => { eval("console.log(1)"); });
Sorry, something went wrong.
fix(coverage): do not generate script coverage with empty url (#24007)
8b5089e
closes #24004
Successfully merging a pull request may close this issue.
Save the below file as
test.ts
:And run the command
deno test --coverage -A test.ts
, then something like the following 2 json files are created:The second json file has empty
url
property and causesdeno coverage
command failure.Notes:
Deno.stat
doesn't cause the same issue.Deno.statSync
called at the top level.Deno.statSync
is called in dependencies (and therefore this affects the@std/fs
test coverage reports, for example)Version: Deno 1.43.6
The text was updated successfully, but these errors were encountered: