File tree 4 files changed +30
-2
lines changed
4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ def packages_with_versions
48
48
# We cannot use the name after "pin" because some dependencies are loaded from inside packages
49
49
# Eg. pin "buffer", to: "https://ga.jspm.io/npm:@jspm/[email protected] /nodelibs/browser/buffer.js"
50
50
51
- importmap . scan ( /^ pin .*(?<=npm:|npm\/ |skypack\. dev\/ |unpkg\. com\/ )(.*)(?=@\d +\. \d +\. \d +)@(\d +\. \d +\. \d +(?:[^\/ \s ["']]*)).*$/ ) |
52
- importmap . scan ( /^ pin ["']([^["']]*)["'].* #.*@(\d +\. \d +\. \d +(?:[^\s ]*)).*$/ )
51
+ importmap . scan ( /pin .*(?<=npm:|npm\/ |skypack\. dev\/ |unpkg\. com\/ )(.*)(?=@\d +\. \d +\. \d +)@(\d +\. \d +\. \d +(?:[^\/ \s ["']]*)).*/m ) |
52
+ importmap . scan ( /pin ["']([^["']]*)["'].* #.*@(\d +\. \d +\. \d +(?:[^\s ]*)).*/m )
53
53
end
54
54
55
55
private
Original file line number Diff line number Diff line change
1
+ ipin "intl-tel-input/build/js/utils.js" ,
2
+ to : "intl-tel-input--build--js--utils.js.js" # @23.5.0
Original file line number Diff line number Diff line change
1
+ ipin "intl-tel-input/build/js/utils.js" ,
2
+ to : "intl-tel-input--build--js--utils.js.js" # @23.3.2
Original file line number Diff line number Diff line change @@ -46,6 +46,30 @@ class Importmap::NpmTest < ActiveSupport::TestCase
46
46
end
47
47
end
48
48
49
+ test "successful outdated packages using multiple lines" do
50
+ npm = Importmap ::Npm . new ( file_fixture ( "multiline_outdated_import_map.rb" ) )
51
+ response = { "dist-tags" => { "latest" => '23.5.0' } } . to_json
52
+
53
+ npm . stub ( :get_json , response ) do
54
+ outdated_packages = npm . outdated_packages
55
+
56
+ assert_equal ( 1 , outdated_packages . size )
57
+ assert_equal ( 'intl-tel-input/build/js/utils.js' , outdated_packages [ 0 ] . name )
58
+ assert_equal ( '23.3.2' , outdated_packages [ 0 ] . current_version )
59
+ assert_equal ( '23.5.0' , outdated_packages [ 0 ] . latest_version )
60
+ end
61
+ end
62
+
63
+ test "successful updarted packages using multiple lines" do
64
+ npm = Importmap ::Npm . new ( file_fixture ( "multiline_updated_import_map.rb" ) )
65
+ response = { "dist-tags" => { "latest" => '23.5.0' } } . to_json
66
+
67
+ npm . stub ( :get_json , response ) do
68
+ outdated_packages = npm . outdated_packages
69
+ assert_equal ( 0 , outdated_packages . size )
70
+ end
71
+ end
72
+
49
73
test "missing outdated packages with mock" do
50
74
response = { "error" => "Not found" } . to_json
51
75
You can’t perform that action at this time.
0 commit comments