Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spec/dummy/spec/packs_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def create_new_component(name)
context "when component with CSS module" do
let(:component_name) { "ComponentWithCSSModule" }
let(:component_pack) { "#{generated_directory}/#{component_name}.js" }
let(:css_module_pack_glob_pattern) { "#{generated_directory}/#{component_name}.module*" }

before do
stub_packer_source_path(component_name: component_name,
Expand Down Expand Up @@ -469,6 +470,15 @@ def create_new_component(name)
expect { eval(sanitized_content) }.not_to raise_error
# rubocop:enable Security/Eval
end

it "does not generate a pack for a CSS module file" do
expect(Dir.glob(css_module_pack_glob_pattern)).to be_empty
end

it "only generates the js pack" do
generated_files = Dir.entries(generated_directory).reject { |f| f.start_with?(".") }
expect(generated_files).to eq([File.basename(component_pack)])
end
end

def generated_server_bundle_file_path
Expand Down
Loading