diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-09-14 17:09:34 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-09-15 01:04:31 +0200 |
commit | 214afe4c1bb9c37bc6159e659d66ba9a268a2849 (patch) | |
tree | 86545eb1b2a4f09f7e2dfc850fe6f4251a569a32 /hugolib | |
parent | cd830bb0275fc39240861627ef26e146985b5c86 (diff) |
modules/npm: Preserve the original package.json if it exists
Fixes #7690
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/hugo_modules_test.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/hugolib/hugo_modules_test.go b/hugolib/hugo_modules_test.go index c3358a0c2..87cddf086 100644 --- a/hugolib/hugo_modules_test.go +++ b/hugolib/hugo_modules_test.go @@ -201,14 +201,16 @@ JS imported in module: | b, clean := newTestBuilder(t, "") defer clean() - b.WithSourceFile("package.json", `{ + const origPackageJSON = `{ "name": "mypack", "version": "1.2.3", "scripts": {}, "dependencies": { "moo": "1.2.3" } -}`) +}` + + b.WithSourceFile("package.json", origPackageJSON) b.Build(BuildCfg{}) b.Assert(npm.Pack(b.H.BaseFs.SourceFs, b.H.BaseFs.Assets.Dirs), qt.IsNil) @@ -244,6 +246,10 @@ JS imported in module: | "version": "1.2.3" }` }) + + // https://github.com/gohugoio/hugo/issues/7690 + b.AssertFileContent("package.hugo.json", origPackageJSON) + }) t.Run("Create package.json, no default, no package.json", func(t *testing.T) { @@ -281,7 +287,9 @@ JS imported in module: | "name": "myhugosite", "version": "0.1.0" }` + }) + }) } |