Skip to content

Commit

Permalink
correction : removes the handler for peer deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-sandhu committed Aug 26, 2024
1 parent dbb2b3e commit a1bebf4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
12 changes: 0 additions & 12 deletions npm_and_yarn/lib/dependabot/npm_and_yarn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ def self.sanitize_resolvability_message(error_message, dependencies, yarn_lock)
Dependabot::MisconfiguredTooling.new("Yarn", message)
}
},
"YN0060" => {
message: "Incompatible peer dependency",
handler: lambda { |message, _error, _params|
Dependabot::DependencyFileNotResolvable.new(message)
}
},
"YN0062" => {
message: "Incompatible OS",
handler: lambda { |message, _error, _params|
Expand Down Expand Up @@ -325,12 +319,6 @@ def self.sanitize_resolvability_message(error_message, dependencies, yarn_lock)
Dependabot::DependencyNotFound.new(message)
end
}
},
"YN0086" => {
message: "Peer dependencies incorrectly met",
handler: lambda { |message, _error, _params|
Dependabot::DependencyFileNotResolvable.new(message)
}
}
}.freeze, T::Hash[String, {
message: T.any(String, NilClass),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,31 +229,6 @@
end
end

context "when the error message contains YN0060 response (Incompatible peer dependency)" do
let(:error_message) do
"[91m➤ YN0060: @typescript-eslint/parser is listed by your project " \
"with version 8.2.0, which doesn't satisfy what @typescript-eslint/[39" \
"meslint-plugin (pe72be) requests (^7.0.0).
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
::group::Fetch step
::endgroup::
➤ YN0060: @typescript-eslint/parser is listed by your" \
" project with version 8.2.0, which doesn't satisfy what " \
"@typescript-eslint/eslint-plugin (pe72be) " \
"requests (^7.0.0).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
::group::Link step"
end

it "raises a DependencyFileNotResolvable error with the correct message" do
expect do
error_handler.handle_yarn_error(error, { yarn_lock: yarn_lock })
end.to raise_error(Dependabot::DependencyFileNotResolvable)
end
end

context "when the error message contains YN0009 response (Build failed)" do
let(:error_message) do
"YN0009: │ @pact-foundation/pact@npm:10.0.0-beta.36 couldn't be built successfully" \
Expand Down Expand Up @@ -282,37 +257,6 @@
end
end

context "when the error message contains YN0086 response (Peer dependencies incorrectly met)" do
let(:error_message) do
"[93m➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain " \
"peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
::endgroup::
➤ YN0060: @typescript-eslint/parser is listed" \
"by your project with version 8.2.0, which doesn't satisfy what " \
"@typescript-eslint/eslint-plugin (pe72be) request" \
" (^7.0.0).
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
::group::Fetch step
::endgroup::
➤ YN0060: @typescript-eslint/parser is listed" \
" by your project with version 8.2.0, which doesn't satisfy what" \
" @typescript-eslint/eslint-plugin (pe" \
"72be) requests (^7.0.0).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
::group::Link step
➤ YN0073: │ Skipped due to mode=update-lockfile
::endgroup::"
end

it "raises a DependencyFileNotResolvable error with the correct message" do
expect do
error_handler.handle_yarn_error(error, { yarn_lock: yarn_lock })
end.to raise_error(Dependabot::DependencyFileNotResolvable)
end
end

context "when the error message contains YN0001 response (findPackageLocation)" do
let(:error_message) do
"[YN0001]: Exception error, Detail: ➤ YN0000: ┌ Resolution step
Expand Down

0 comments on commit a1bebf4

Please sign in to comment.