Skip to content

Commit

Permalink
Updated failing NPM6 tests to use NPM8 fixtures as NPM6 is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
amazimbe committed Feb 28, 2025
1 parent 75644f6 commit 6cf1ed4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions npm_and_yarn/spec/dependabot/npm_and_yarn/file_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,18 @@
stub_request(:get, File.join(url, "yarn.lock?ref=sha"))
.with(headers: { "Authorization" => "token token" })
.to_return(status: 404)
stub_request(:get, File.join(url, "package.json?ref=sha"))
.with(headers: { "Authorization" => "token token" })
.to_return(
status: 200,
body: fixture_to_response("projects/npm8/simple", "package.json"),
headers: json_header
)
stub_request(:get, File.join(url, "package-lock.json?ref=sha"))
.with(headers: { "Authorization" => "token token" })
.to_return(
status: 200,
body: fixture("github", "package_lock_content.json"),
body: fixture_to_response("projects/npm8/simple", "package-lock.json"),
headers: json_header
)
end
Expand All @@ -623,7 +630,7 @@

it "parses the npm lockfile" do
expect(file_fetcher_instance.ecosystem_versions).to eq(
{ package_managers: { "npm" => 6 } }
{ package_managers: { "npm" => 8 } }
)
end
end
Expand All @@ -648,7 +655,7 @@
.with(headers: { "Authorization" => "token token" })
.to_return(
status: 200,
body: fixture("github", "package_lock_content.json"),
body: fixture_to_response("projects/npm8/simple", "package-lock.json"),
headers: json_header
)
end
Expand All @@ -660,7 +667,7 @@

it "parses the package manager version" do
expect(file_fetcher_instance.ecosystem_versions).to eq(
{ package_managers: { "npm" => 6, "yarn" => 1 } }
{ package_managers: { "npm" => 8, "yarn" => 1 } }
)
end
end
Expand Down

0 comments on commit 6cf1ed4

Please sign in to comment.