Deno: Inconsistent UX between `deno run` and `deno test`

Created on 24 Feb 2020  ·  3Comments  ·  Source: denoland/deno

On a mac:

> deno test bad_module.ts
No such file or directory (os error 2)

Versus:

> deno run bad_module.ts
Cannot resolve module "file:///Users/kkelly/github/deno/bad_module.ts"

The deno run is far more informative and consistent across OSes.

bug

Most helpful comment

My only argument is that it should be normalized across OSes and should include the full path that was attempted to be resolved. Sometimes with complex relative URLs, it might hard to determine what is what.

All 3 comments

I think No such file or directory (os error 2) is actually the better error message here. The deno run error message suggests we're doing unnecessary processing. The process should try to open the file, and simply error out if it's not there. Certainly it shouldn't be booting up V8.

My only argument is that it should be normalized across OSes and should include the full path that was attempted to be resolved. Sometimes with complex relative URLs, it might hard to determine what is what.

Tested on 1.4.0

▶ deno test bad_module.ts
error: Cannot resolve module "file:///Users/biwanczuk/dev/deno/bad_module.ts" from "file:///Users/biwanczuk/dev/deno/.deno.test.ts"
Imported from "file:///Users/biwanczuk/dev/deno/.deno.test.ts:1"

~/dev/deno  run_watch_unload ✔                                                                                                                                                                              19m  ⍉
▶ deno run bad_module.ts
error: Cannot resolve module "file:///Users/biwanczuk/dev/deno/bad_module.ts"

Seems this issue is resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  ·  3Comments

benjamingr picture benjamingr  ·  3Comments

justjavac picture justjavac  ·  3Comments

kitsonk picture kitsonk  ·  3Comments

metakeule picture metakeule  ·  3Comments