From ddb5449f42051a2c7e92142a5d0750cdc49cb281 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 21 May 2024 16:12:40 -0400 Subject: chore: add test to ensure parsing only happens once on first load (#23837) --- tests/specs/run/no_reparse_first_load/__test__.jsonc | 6 ++++++ tests/specs/run/no_reparse_first_load/main.out | 2 ++ tests/specs/run/no_reparse_first_load/main.ts | 1 + 3 files changed, 9 insertions(+) create mode 100644 tests/specs/run/no_reparse_first_load/__test__.jsonc create mode 100644 tests/specs/run/no_reparse_first_load/main.out create mode 100644 tests/specs/run/no_reparse_first_load/main.ts (limited to 'tests') diff --git a/tests/specs/run/no_reparse_first_load/__test__.jsonc b/tests/specs/run/no_reparse_first_load/__test__.jsonc new file mode 100644 index 000000000..cd6e60e72 --- /dev/null +++ b/tests/specs/run/no_reparse_first_load/__test__.jsonc @@ -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" +} diff --git a/tests/specs/run/no_reparse_first_load/main.out b/tests/specs/run/no_reparse_first_load/main.out new file mode 100644 index 000000000..08af76600 --- /dev/null +++ b/tests/specs/run/no_reparse_first_load/main.out @@ -0,0 +1,2 @@ +[WILDCARD]Removed parsed source: file:///[WILDLINE]/main.ts +[WILDCARD] diff --git a/tests/specs/run/no_reparse_first_load/main.ts b/tests/specs/run/no_reparse_first_load/main.ts new file mode 100644 index 000000000..bf6b81796 --- /dev/null +++ b/tests/specs/run/no_reparse_first_load/main.ts @@ -0,0 +1 @@ +console.log("Hello"); -- cgit v1.2.3