File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ def create_new_component(name)
438438 context "when component with CSS module" do
439439 let ( :component_name ) { "ComponentWithCSSModule" }
440440 let ( :component_pack ) { "#{ generated_directory } /#{ component_name } .js" }
441+ let ( :css_module_pack_glob_pattern ) { "#{ generated_directory } /#{ component_name } .module*" }
441442
442443 before do
443444 stub_packer_source_path ( component_name : component_name ,
@@ -469,6 +470,15 @@ def create_new_component(name)
469470 expect { eval ( sanitized_content ) } . not_to raise_error
470471 # rubocop:enable Security/Eval
471472 end
473+
474+ it "does not generate a pack for a CSS module file" do
475+ expect ( Dir . glob ( css_module_pack_glob_pattern ) ) . to be_empty
476+ end
477+
478+ it "only generates the js pack" do
479+ generated_files = Dir . entries ( generated_directory ) . reject { |f | f . start_with? ( "." ) }
480+ expect ( generated_files ) . to eq ( [ File . basename ( component_pack ) ] )
481+ end
472482 end
473483
474484 def generated_server_bundle_file_path
You can’t perform that action at this time.
0 commit comments