Skip to content

Commit

Permalink
add failed parse domain tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yazan-nidal committed May 7, 2024
1 parent f8bfa41 commit 589d407
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
11 changes: 7 additions & 4 deletions cli/args/flags.rs
Expand Up @@ -9644,10 +9644,13 @@ mod tests {
subcommand: DenoSubcommand::Run(RunFlags::new_default(
"script.ts".to_string()
)),
allow_env: Some(vec![], ),
allow_net: Some(vec!["api.notion.com".to_string(), "*.amazonaws.com".to_string(), ], ),
allow_read: Some(vec![], ),
allow_write: Some(vec!["notion-next".to_string(), ], ),
permissions: PermissionFlags {
allow_env: Some(vec![], ),
allow_net: Some(vec!["api.notion.com".to_string(), "*.amazonaws.com".to_string(), ], ),
allow_read: Some(vec![], ),
allow_write: Some(vec!["notion-next".to_string(), ], ),
..Default::default()
},
unstable_config: UnstableConfig {
..Default::default()
},
Expand Down
9 changes: 0 additions & 9 deletions tests/specs/fqdn/valid_domain/__test__.jsonc

This file was deleted.

3 changes: 0 additions & 3 deletions tests/specs/fqdn/valid_domain/main.js

This file was deleted.

Empty file.
@@ -0,0 +1,15 @@
{
"tempDir": true,
"steps": [
{
"args": " run --allow-read --allow-env --allow-write=notion-next --allow-net=api.notion.com,www.google.com,*.amazon.com main.js",
"output": "err_i.out",
"exitCode": 1
},
{
"args": " run --allow-net main.js",
"output": "err_ii.out",
"exitCode": 1
}
]
}
@@ -0,0 +1,4 @@
error: Failed to parse *.amazon.com

Caused by:
invalid char found in FQDN
@@ -0,0 +1,2 @@
error: Uncaught (in promise) Error: No such host is known. (os error 11001)
at async Object.connect (ext:deno_net/01_net.js:587:55)
@@ -0,0 +1,2 @@
Deno.connect({hostname:'api.notion.com.', port: 443});
Deno.connect({hostname:'*.amazon.com.', port: 443});

0 comments on commit 589d407

Please sign in to comment.