Skip to content
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

deno coverage doesn't use import maps and is unable to retrieve files #10395

Closed
Tracked by #12826
andreas-wagner opened this issue Apr 27, 2021 · 5 comments
Closed
Tracked by #12826
Assignees
Labels
cli related to cli/ dir suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage

Comments

@andreas-wagner
Copy link

Hi, my files are on gitlab.com, which doesn't provide proper headers and as such is unusable with Deno.

Because of this I have written a small software layer and am using import maps so that cache and lsp are able to get the files, which works fine.

Since coverage doesn't do that, it is unable to retrieve the files and build the coverage.

Don't get me wrong, the files are there, but in <cache>/deps/http/127.0.0.1_PORT3124 instead of <cache>/deps/https/gitlab.com.

"Easy" fix would be to have import maps on the coverage subcommand as well.

@lucacasonato lucacasonato added cli related to cli/ dir suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage labels Apr 27, 2021
@lucacasonato
Copy link
Member

cc @caspervonb

@caspervonb
Copy link
Contributor

Will look into it.

@lowlighter
Copy link
Contributor

Here's a minimal reproduction if needed:

import type { LevelName } from "std/log/levels.ts"
Deno.test("test", () => {})
{
  "imports":{
    "std/":"https://raw.githubusercontent.com/denoland/deno_std/69f3d67cb2119e948c91fc471df9d4a0886523a3/"
  }
}
deno test --import-map imports.json --coverage=coverage test.ts
# test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (77ms)

deno coverage coverage
# error: Relative import path "std/log/levels.ts" not prefixed with / or ./ or ../ from "file:///test.ts"

deno --version
# deno 1.12.1 (release, x86_64-pc-windows-msvc)
# v8 9.2.230.14
# typescript 4.3.5

@caspervonb
Copy link
Contributor

Here's a minimal reproduction if needed:

import type { LevelName } from "std/log/levels.ts"
Deno.test("test", () => {})
{
 "imports":{
   "std/":"https://raw.githubusercontent.com/denoland/deno_std/69f3d67cb2119e948c91fc471df9d4a0886523a3/"
 }
}
deno test --import-map imports.json --coverage=coverage test.ts
# test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (77ms)

deno coverage coverage
# error: Relative import path "std/log/levels.ts" not prefixed with / or ./ or ../ from "file:///test.ts"

deno --version
# deno 1.12.1 (release, x86_64-pc-windows-msvc)
# v8 9.2.230.14
# typescript 4.3.5

Thanks @lowlighter, appreciate it.

@bartlomieju
Copy link
Member

I tried provided reproduction and it appears it was fixed by #13324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage
Projects
None yet
Development

No branches or pull requests

5 participants