Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UX for UsePackwerk.move_to_parent! #13

Merged
merged 5 commits into from
Aug 18, 2022
Merged
Changes from 1 commit
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
Next Next commit
add failing test
  • Loading branch information
Alex Evanczuk committed Aug 18, 2022
commit f90c2c78480f60eaeb873ca06403b1c0f91bd699
16 changes: 16 additions & 0 deletions spec/use_packwerk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,22 @@ def expect_files_to_not_exist(files)
OUTPUT
end

it 'rewrites other packs package.yml files to point to the new nested package' do
write_package_yml('packs/fruits', dependencies: ['packs/apples'])
write_package_yml('packs/other_pack', dependencies: ['packs/apples', 'packs/something_else'])
write_package_yml('packs/apples')

UsePackwerk.move_to_parent!(
pack_name: 'packs/apples',
parent_name: 'packs/fruits',
)

ParsePackwerk.bust_cache!

expect(ParsePackwerk.find('packs/fruits').dependencies).to eq(['packs/fruits/apples'])
expect(ParsePackwerk.find('packs/other_pack').dependencies).to eq(['packs/fruits/apples', 'packs/something_else'])
end

context 'parent pack does not already exist' do
it 'creates it' do
# Parent pack does not exist!
Expand Down