Skip to content

Commit bc563f4

Browse files
author
Takashi Kato
committed
importmap key reflects the directory
1 parent ed1f3a7 commit bc563f4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/helpers/importmap_mocha/test_helper.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
module ImportmapMocha::TestHelper
22
def testcase
3-
s = files.map do |f|
4-
javascript_import_module_tag(f.basename('.js'))
5-
end
6-
s.join('').html_safe
3+
files.map{|m| javascript_import_module_tag(m.to_s.sub('.js', '')) }.join("\n").html_safe
74
end
85

96
def files
10-
root_path.flat_map{|path| path.glob('**/*.js')}
7+
root_path.flat_map{|path| path.glob('**/*.js').map{|m| m.relative_path_from(path)}}
118
end
129

1310
def root_path

0 commit comments

Comments
 (0)