From fee4943f760fae2c9386ceeda86c3f8fbfd8e6a0 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 8 Mar 2024 14:14:28 -0500 Subject: fix(node): resolve .css files in npm packages when type checking (#22804) When type checking, we should just resolve css files in npm packages and not surface a type checking error on the specifier. --- tests/integration/npm_tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/integration') diff --git a/tests/integration/npm_tests.rs b/tests/integration/npm_tests.rs index e4e06e830..7c34415da 100644 --- a/tests/integration/npm_tests.rs +++ b/tests/integration/npm_tests.rs @@ -2551,6 +2551,22 @@ console.log(getValue()); output.assert_matches_text("Check file:///[WILDCARD]/main.ts\n"); } +#[test] +fn check_css_package_json_exports() { + let test_context = TestContextBuilder::for_npm().use_temp_cwd().build(); + let dir = test_context.temp_dir(); + dir.write( + "main.ts", + r#"import "npm:@denotest/css-export/dist/index.css";"#, + ); + test_context + .new_command() + .args("check main.ts") + .run() + .assert_matches_text("Download [WILDCARD]css-export\nDownload [WILDCARD]css-export/1.0.0.tgz\nCheck [WILDCARD]/main.ts\n") + .assert_exit_code(0); +} + #[test] fn cjs_export_analysis_require_re_export() { let test_context = TestContextBuilder::for_npm().use_temp_cwd().build(); -- cgit v1.2.3