Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Julio Chana <julio.chana@lokalise.com>
  • Loading branch information
jchanam committed Dec 26, 2024
1 parent bfd408c commit 6e60747
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion plugin/builtin/patchtransformer/PatchTransformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,17 @@ func TestPatchTransformerPatchEmpty(t *testing.T) {
PrepBuiltin("PatchTransformer")
defer th.Reset()

th.WriteF("patch.yaml", `
`)

th.RunTransformerAndCheckError(`
apiVersion: builtin
kind: PatchTransformer
metadata:
name: notImportantHere
path: patch.yaml
target:
name: myDeploy
`, someDeploymentResources, func(t *testing.T, err error) {
if err != nil {
t.Fatalf("unexpected error")
Expand All @@ -1127,10 +1137,20 @@ func TestPatchTransformerPatchEmptyOnlyComments(t *testing.T) {
PrepBuiltin("PatchTransformer")
defer th.Reset()

th.RunTransformerAndCheckError(`
th.WriteF("patch.yaml", `
# File with only comments
# Is a virtually empty yaml
`)

th.RunTransformerAndCheckError(`
apiVersion: builtin
kind: PatchTransformer
metadata:
name: notImportantHere
path: patch.yaml
target:
name: myDeploy
`, someDeploymentResources, func(t *testing.T, err error) {
if err != nil {
t.Fatalf("unexpected error")
Expand Down

0 comments on commit 6e60747

Please sign in to comment.