mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: add test to ensure parsing only happens once on first load (#23837)
This commit is contained in:
parent
9795637724
commit
ddb5449f42
4 changed files with 11 additions and 0 deletions
2
cli/cache/parsed_source.rs
vendored
2
cli/cache/parsed_source.rs
vendored
|
@ -77,6 +77,8 @@ impl ParsedSourceCache {
|
|||
if parsed_source.media_type() == media_type
|
||||
&& parsed_source.text_info().text_str() == source.as_ref()
|
||||
{
|
||||
// note: message used tests
|
||||
log::debug!("Removed parsed source: {}", specifier);
|
||||
return Ok(parsed_source);
|
||||
}
|
||||
}
|
||||
|
|
6
tests/specs/run/no_reparse_first_load/__test__.jsonc
Normal file
6
tests/specs/run/no_reparse_first_load/__test__.jsonc
Normal file
|
@ -0,0 +1,6 @@
|
|||
// ensures we don't reparse a source file when transpiling
|
||||
// because it should have already been parsed by module analysis
|
||||
{
|
||||
"args": "run --log-level=debug main.ts",
|
||||
"output": "main.out"
|
||||
}
|
2
tests/specs/run/no_reparse_first_load/main.out
Normal file
2
tests/specs/run/no_reparse_first_load/main.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
[WILDCARD]Removed parsed source: file:///[WILDLINE]/main.ts
|
||||
[WILDCARD]
|
1
tests/specs/run/no_reparse_first_load/main.ts
Normal file
1
tests/specs/run/no_reparse_first_load/main.ts
Normal file
|
@ -0,0 +1 @@
|
|||
console.log("Hello");
|
Loading…
Reference in a new issue