From ce3fbb4bd1bcdfbead8fb795d1ff2f71c6051bf4 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 5 Jul 2021 15:21:44 -0400 Subject: [PATCH] chore: add tests for previous assertion error when file contained only triple slash references (#11285) --- cli/tests/info/data_null_error/data_null_error.out | 6 ++++++ cli/tests/info/data_null_error/mod.ts | 1 + cli/tests/info/data_null_error/types.d.ts | 1 + cli/tests/integration/info_tests.rs | 7 +++++++ 4 files changed, 15 insertions(+) create mode 100644 cli/tests/info/data_null_error/data_null_error.out create mode 100644 cli/tests/info/data_null_error/mod.ts create mode 100644 cli/tests/info/data_null_error/types.d.ts diff --git a/cli/tests/info/data_null_error/data_null_error.out b/cli/tests/info/data_null_error/data_null_error.out new file mode 100644 index 0000000000..89961be656 --- /dev/null +++ b/cli/tests/info/data_null_error/data_null_error.out @@ -0,0 +1,6 @@ +local: [WILDCARD]mod.ts +type: TypeScript +dependencies: 1 unique (total [WILDCARD]) + +file://[WILDCARD]/mod.ts ([WILDCARD]) +└── file://[WILDCARD]/types.d.ts ([WILDCARD]) diff --git a/cli/tests/info/data_null_error/mod.ts b/cli/tests/info/data_null_error/mod.ts new file mode 100644 index 0000000000..6e3e99bd4f --- /dev/null +++ b/cli/tests/info/data_null_error/mod.ts @@ -0,0 +1 @@ +/// diff --git a/cli/tests/info/data_null_error/types.d.ts b/cli/tests/info/data_null_error/types.d.ts new file mode 100644 index 0000000000..6ecc856768 --- /dev/null +++ b/cli/tests/info/data_null_error/types.d.ts @@ -0,0 +1 @@ +declare class Test {} diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs index 190c0330c5..3bba89cc00 100644 --- a/cli/tests/integration/info_tests.rs +++ b/cli/tests/integration/info_tests.rs @@ -111,3 +111,10 @@ itest!(_054_info_local_imports { output: "054_info_local_imports.out", exit_code: 0, }); + +// Tests for AssertionError where "data" is unexpectedly null when +// a file contains only triple slash references (#11196) +itest!(data_null_error { + args: "info info/data_null_error/mod.ts", + output: "info/data_null_error/data_null_error.out", +});