File tree Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class JavascriptPackageTest < ActiveSupport ::TestCase
6
6
def test_compiled_code_is_in_sync_with_source_code
7
- compiled_file = File . expand_path ( "../app/assets/javascripts/action_cable.js" , __dir__ )
7
+ compiled_files = %w[
8
+ app/assets/javascripts/actioncable.js
9
+ app/assets/javascripts/actioncable.esm.js
10
+ app/assets/javascripts/action_cable.js
11
+ ] . map do |file |
12
+ Pathname ( file ) . expand_path ( "#{ __dir__ } /.." )
13
+ end
8
14
9
- assert_no_changes -> { File . read ( compiled_file ) } do
10
- system "yarn build"
15
+ assert_no_changes -> { compiled_files . map ( & :read ) } do
16
+ system "yarn build" , exception : true
11
17
end
12
18
end
13
19
end
Original file line number Diff line number Diff line change 2
2
3
3
class JavascriptPackageTest < ActiveSupport ::TestCase
4
4
def test_compiled_code_is_in_sync_with_source_code
5
- assert_no_changes -> {
6
- %w[
7
- app/assets/javascripts/rails-ujs.js
8
- app/assets/javascripts/rails-ujs.esm.js
9
- ] . map { | compiled_file |
10
- File . read ( File . expand_path ( "../ #{ compiled_file } " , __dir__ ) )
11
- }
12
- } do
13
- system "yarn build"
5
+ compiled_files = %w[
6
+ app/assets/javascripts/rails-ujs.js
7
+ app/assets/javascripts/rails-ujs.esm .js
8
+ ] . map do | file |
9
+ Pathname ( file ) . expand_path ( " #{ __dir__ } /.." )
10
+ end
11
+
12
+ assert_no_changes -> { compiled_files . map ( & :read ) } do
13
+ system "yarn build" , exception : true
14
14
end
15
15
end
16
16
end
Original file line number Diff line number Diff line change 4
4
5
5
class JavascriptPackageTest < ActiveSupport ::TestCase
6
6
def test_compiled_code_is_in_sync_with_source_code
7
- compiled_file = File . expand_path ( "../app/assets/javascripts/activestorage.js" , __dir__ )
7
+ compiled_files = %w[
8
+ app/assets/javascripts/activestorage.js
9
+ app/assets/javascripts/activestorage.esm.js
10
+ ] . map do |file |
11
+ Pathname ( file ) . expand_path ( "#{ __dir__ } /.." )
12
+ end
8
13
9
- assert_no_changes -> { File . read ( compiled_file ) } do
10
- system "yarn build"
14
+ assert_no_changes -> { compiled_files . map ( & :read ) } do
15
+ system "yarn build" , exception : true
11
16
end
12
17
end
13
18
end
You can’t perform that action at this time.
0 commit comments