Skip to content

Commit

Permalink
update spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tagCincy committed Dec 12, 2023
1 parent 8542c1f commit bb7c462
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/propshaft/compiler/source_mapping_urls_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class Propshaft::Compiler::SourceMappingUrlsTest < ActiveSupport::TestCase
end

test "matching source map" do
assert_match %r{//# sourceMappingURL=/assets/source.js-[a-z0-9]{40}\.map},
assert_match %r{//# sourceMappingURL=/assets/source-[a-z0-9]{40}\.js.map},
compile_asset(find_asset("source.js", fixture_path: "mapped"))
assert_match %r{/\*# sourceMappingURL=/assets/source.css-[a-z0-9]{40}\.map},
assert_match %r{/\*# sourceMappingURL=/assets/source-[a-z0-9]{40}\.css.map},
compile_asset(find_asset("source.css", fixture_path: "mapped"))
end

test "matching nested source map" do
assert_match %r{//# sourceMappingURL=/assets/nested/another-source.js-[a-z0-9]{40}\.map},
assert_match %r{//# sourceMappingURL=/assets/nested/another-source-[a-z0-9]{40}\.js.map},
compile_asset(find_asset("nested/another-source.js", fixture_path: "mapped"))
end

Expand All @@ -38,9 +38,9 @@ class Propshaft::Compiler::SourceMappingUrlsTest < ActiveSupport::TestCase
end

test "sourceMappingURL not at the beginning of the line, but at end of file, is processed" do
assert_match %r{//# sourceMappingURL=/assets/sourceMappingURL-not-at-start.js-[a-z0-9]{40}\.map},
assert_match %r{//# sourceMappingURL=/assets/sourceMappingURL-not-at-start-[a-z0-9]{40}\.js.map},
compile_asset(find_asset("sourceMappingURL-not-at-start.js", fixture_path: "mapped"))
assert_match %r{/\*# sourceMappingURL=/assets/sourceMappingURL-not-at-start.css-[a-z0-9]{40}\.map \*/},
assert_match %r{/\*# sourceMappingURL=/assets/sourceMappingURL-not-at-start-[a-z0-9]{40}\.css.map \*/},
compile_asset(find_asset("sourceMappingURL-not-at-start.css", fixture_path: "mapped"))
end

Expand All @@ -56,7 +56,7 @@ class Propshaft::Compiler::SourceMappingUrlsTest < ActiveSupport::TestCase
test "relative url root" do
@options.relative_url_root = "/url-root"

assert_match %r{//# sourceMappingURL=/url-root/assets/source.js-[a-z0-9]{40}\.map},
assert_match %r{//# sourceMappingURL=/url-root/assets/source-[a-z0-9]{40}\.js.map},
compile_asset(find_asset("source.js", fixture_path: "mapped"))
end

Expand Down

0 comments on commit bb7c462

Please sign in to comment.