1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00
denoland-deno/tests/specs/run
Hasan-Alrimawi e44c538f37
fix: --env flag confusing message on syntax error (#23915)
Enhanced warning message for --env flag with run and eval subcommands. 

The commit is specifically made to address issue #23674 by improving the
warning messages that appear when using the --env flag with run or eval
subcommands in the following scenarios:

1. Missing environment file.
2. Incorrect syntax in the environment file content.


**Changes made**

- Distinguishes between cases of missing environment file and wrong
syntax in the environment file content.
- Shows a concise warning message to convey the case/issue occurred.

**Code changes & enhancements**
- Implemented a match statement to handle different types of errors
received while getting and parsing the file content to display a concise
warning message, rather than simple error check and then displaying the
same warning message for whatever the type of error is.
- Updated the related existing tests to reflect the new warning
messages.
- Added two test cases to cover the wrong environment file content
syntax with both run and eval subcommands.

**Impact**
The use of --env flag with both run/eval would be more user-friendly as
it gives a precise description of what is not right when using
incorrectly.

If you could give it a look, @dsherret , I appreciate your feedback on
these changes.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-27 15:06:18 +02:00
..
045_proxy feat(ext/fetch): Request.bytes() and Response.bytes() (#23823) 2024-05-23 00:27:58 +00:00
env_unparsable_file fix: --env flag confusing message on syntax error (#23915) 2024-05-27 15:06:18 +02:00
import_map_parent_dir fix: handle specifying an import map in an ancestor dir of deno.json (#23602) 2024-04-29 14:32:27 -04:00
invalid_emit_options fix(cli): Don't panic on invalid emit options (#23463) 2024-04-23 08:50:50 -07:00
keep_comments_ts fix(emit): regression - keep comments in emit (#23815) 2024-05-14 22:01:31 +00:00
no_deno_json chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
no_reparse_first_load chore: add test to ensure parsing only happens once on first load (#23837) 2024-05-21 16:12:40 -04:00
redirect_javascript chore(specs): use jsonc for metadata file (#22946) 2024-03-15 17:27:52 +00:00
unref_stdin fix: unref stdin read (#23534) 2024-04-25 05:32:01 +00:00
v8_jitless test: add test for running in V8 jitless mode (#23054) 2024-04-15 23:47:01 +00:00
workspaces fix(workspace): provide workspace members as 'imports' in import map (#23492) 2024-04-23 17:21:06 +02:00