Skip to content

Commit

Permalink
adding test to file updater
Browse files Browse the repository at this point in the history
  • Loading branch information
robaiken committed Jan 31, 2025
1 parent 18f5d88 commit 1f372e9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions npm_and_yarn/spec/dependabot/npm_and_yarn/file_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4266,6 +4266,40 @@
expect(updated_pnpm_workspace.content).to include("react: \"^18.2.3\"")
expect(updated_pnpm_workspace.content).to include("react-dom: '^18.2.3'")
end

context "when updating workspace catalog entries" do
let(:project_name) { "pnpm/catalog_prettier" }
let(:dependency_name) { "prettier" }
let(:version) { "3.3.3" }
let(:previous_version) { "3.3.0" }
let(:requirements) do
[{
file: "pnpm-workspace.yaml",
requirement: "3.3.3",
groups: ["catalog"],
source: nil
}]
end
let(:previous_requirements) do
[{
file: "pnpm-workspace.yaml",
requirement: "3.3.0",
groups: ["catalog"],
source: nil
}]
end

it "uses pnpm install for catalog updates" do
expect(Dependabot::NpmAndYarn::Helpers).to receive(:run_pnpm_command)
.with("install --lockfile-only")
.ordered

expect(Dependabot::NpmAndYarn::Helpers).not_to receive(:run_pnpm_command)
.with(/update.*--lockfile-only/)

updated_files
end
end
end
end
end
Expand Down

0 comments on commit 1f372e9

Please sign in to comment.