Skip to content

Commit

Permalink
fix broken test (fixes ordering issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed May 3, 2024
1 parent e433327 commit b6257c6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions config/json/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,23 @@ func Test_TransformDeployToJSON(t *testing.T) {
}
}`)

var jsonDeployments jsonDeployments
err := json.Unmarshal(b, &jsonDeployments)
var original jsonDeployments
err := json.Unmarshal(b, &original)
assert.NoError(t, err)

deployments, err := jsonDeployments.transformToConfig()
deployments, err := original.transformToConfig()
assert.NoError(t, err)

j := transformDeploymentsToJSON(deployments)
x, _ := json.Marshal(j)

assert.Equal(t, cleanSpecialChars(b), cleanSpecialChars(x))
// Unmarshal the config again to compare against the original
var result jsonDeployments
err = json.Unmarshal(x, &result)
assert.NoError(t, err)

// Check that result is same as original after transformation
assert.Equal(t, original, result)
}

func Test_DeploymentAdvanced(t *testing.T) {
Expand Down

0 comments on commit b6257c6

Please sign in to comment.