-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move over to passing packages as array in POST body
- Loading branch information
1 parent
62f7f93
commit ebddf48
Showing
3 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,25 +7,25 @@ class Importmap::JspmApiIntegrationTest < ActiveSupport::TestCase | |
end | ||
|
||
test "#download when given a valid input" do | ||
result = @jspm_api.download(versioned_package_name: "@popperjs/[email protected]", provider: "jspm.io", exclude: []) | ||
result = @jspm_api.download(versioned_package_names: ["@popperjs/[email protected]"], provider: "jspm.io", exclude: []) | ||
|
||
assert result.keys.include?("lib/dom-utils/getWindow.js") | ||
assert result.keys.include?("lib/index.js") | ||
assert result["@popperjs/[email protected]"].keys.include?("lib/dom-utils/getWindow.js") | ||
assert result["@popperjs/[email protected]"].keys.include?("lib/index.js") | ||
|
||
result = @jspm_api.download(versioned_package_name: "@popperjs/[email protected]", provider: "jspm", exclude: []) | ||
result = @jspm_api.download(versioned_package_names: ["@popperjs/[email protected]"], provider: "jspm", exclude: []) | ||
|
||
assert result.keys.include?("lib/dom-utils/getWindow.js") | ||
assert result.keys.include?("lib/index.js") | ||
assert result["@popperjs/[email protected]"].keys.include?("lib/dom-utils/getWindow.js") | ||
assert result["@popperjs/[email protected]"].keys.include?("lib/index.js") | ||
end | ||
|
||
test "#download when given a bad package" do | ||
result = @jspm_api.download(versioned_package_name: "@popperjs/corenoversion", provider: "jspm.io", exclude: []) | ||
result = @jspm_api.download(versioned_package_names: ["@popperjs/corenoversion"], provider: "jspm.io", exclude: []) | ||
|
||
assert_equal result, {} | ||
end | ||
|
||
test "#download when given a bad provider" do | ||
result = @jspm_api.download(versioned_package_name: "@popperjs/corenoversion", provider: "jspmfoobarbaz", exclude: []) | ||
result = @jspm_api.download(versioned_package_names: ["@popperjs/corenoversion"], provider: "jspmfoobarbaz", exclude: []) | ||
|
||
assert_equal result, {} | ||
end | ||
|
@@ -35,7 +35,7 @@ class Importmap::JspmApiIntegrationTest < ActiveSupport::TestCase | |
Importmap::JspmApi.download_endpoint = URI("https://invalid./error") | ||
|
||
assert_raises(Importmap::JspmApi::HTTPError) do | ||
@jspm_api.download(versioned_package_name: "@popperjs/[email protected]", provider: "jspm.io", exclude: []) | ||
@jspm_api.download(versioned_package_names: ["@popperjs/[email protected]"], provider: "jspm.io", exclude: []) | ||
end | ||
ensure | ||
Importmap::JspmApi.download_endpoint = original_endpoint | ||
|