From 6981add77ce4b0f8c9ae373348d08b0a83b2439b Mon Sep 17 00:00:00 2001 From: Breno Gazzola Date: Mon, 22 Jan 2024 22:12:14 -0300 Subject: [PATCH] Fix broken tests after digest shortening --- .../assets/mapped/sourceMappingURL-already-prefixed.js | 2 +- test/propshaft/compiler/source_mapping_urls_test.rb | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/fixtures/assets/mapped/sourceMappingURL-already-prefixed.js b/test/fixtures/assets/mapped/sourceMappingURL-already-prefixed.js index 5bdf328..4778ca4 100644 --- a/test/fixtures/assets/mapped/sourceMappingURL-already-prefixed.js +++ b/test/fixtures/assets/mapped/sourceMappingURL-already-prefixed.js @@ -1 +1 @@ -var fun; //# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js.map +var fun; //# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js.map \ No newline at end of file diff --git a/test/propshaft/compiler/source_mapping_urls_test.rb b/test/propshaft/compiler/source_mapping_urls_test.rb index 8b2e0b8..dc69f27 100644 --- a/test/propshaft/compiler/source_mapping_urls_test.rb +++ b/test/propshaft/compiler/source_mapping_urls_test.rb @@ -54,14 +54,14 @@ class Propshaft::Compiler::SourceMappingUrlsTest < ActiveSupport::TestCase end test "sourceMapURL is already prefixed with url_prefix" do - assert_match %r{//# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js-[a-z0-9]{40}\.map}, + assert_match %r{//# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js-[a-z0-9]{8}\.map}, compile_asset(find_asset("sourceMappingURL-already-prefixed.js", fixture_path: "mapped")) - assert_match %r{//# sourceMappingURL=/assets/nested/sourceMappingURL-already-prefixed-nested.js-[a-z0-9]{40}\.map}, + assert_match %r{//# sourceMappingURL=/assets/nested/sourceMappingURL-already-prefixed-nested.js-[a-z0-9]{8}\.map}, compile_asset(find_asset("nested/sourceMappingURL-already-prefixed-nested.js", fixture_path: "mapped")) end test "sourceMapURL is already prefixed with an incorrect url_prefix" do - refute_match %r{//# sourceMappingURL=thisisinvalidassets/sourceMappingURL-already-prefixed-invalid.js-[a-z0-9]{40}\.map}, + refute_match %r{//# sourceMappingURL=thisisinvalidassets/sourceMappingURL-already-prefixed-invalid.js-[a-z0-9]{8}\.map}, compile_asset(find_asset("sourceMappingURL-already-prefixed-invalid.js", fixture_path: "mapped")) end @@ -82,3 +82,6 @@ def compile_asset(asset) assembly.compilers.compile(asset) end end + +# //# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js-[a-z0-9]{40}.map +# //# sourceMappingURL=/assets/sourceMappingURL-already-prefixed.js-da39a3ee.map