diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-12-15 10:52:53 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-12-16 08:33:10 +0100 |
commit | 744b8566ec8ea138a63d3787dc2a0dd81511e492 (patch) | |
tree | 438e1c7127375eaaef3db610f318fd8b5dec803c /internal | |
parent | 7de5317aef7866ed559f0dbcd2f3370944b30ed6 (diff) | |
download | hugo-744b8566ec8ea138a63d3787dc2a0dd81511e492.tar.gz hugo-744b8566ec8ea138a63d3787dc2a0dd81511e492.zip |
Fix a rebuild on resource rename case
Diffstat (limited to 'internal')
-rw-r--r-- | internal/js/esbuild/batch_integration_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/js/esbuild/batch_integration_test.go b/internal/js/esbuild/batch_integration_test.go index 07f99ee4e..3501f820a 100644 --- a/internal/js/esbuild/batch_integration_test.go +++ b/internal/js/esbuild/batch_integration_test.go @@ -184,6 +184,20 @@ func TestBatchEditScriptParam(t *testing.T) { b.AssertFileContent("public/mybatch/mygroup.js", "param-p1-main-edited") } +func TestBatchRenameBundledScript(t *testing.T) { + files := jsBatchFilesTemplate + b := hugolib.TestRunning(t, files, hugolib.TestOptWithOSFs()) + b.AssertFileContent("public/mybatch/p1.js", "P1 Script") + b.RenameFile("content/p1/p1script.js", "content/p1/p1script2.js") + _, err := b.BuildE() + b.Assert(err, qt.IsNotNil) + b.Assert(err.Error(), qt.Contains, "resource not set") + + // Rename it back. + b.RenameFile("content/p1/p1script2.js", "content/p1/p1script.js") + b.Build() +} + func TestBatchErrorScriptResourceNotSet(t *testing.T) { files := strings.Replace(jsBatchFilesTemplate, `(resources.Get "js/main.js")`, `(resources.Get "js/doesnotexist.js")`, 1) b, err := hugolib.TestE(t, files, hugolib.TestOptWithOSFs()) |