mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
fix syft-json test to use pretty json for snapshot testing (#2441)
without this fix, capturing fixtures will result in hard-to-read failures in testing. Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
17c605822e
commit
f4dd36ca9d
@ -297,10 +297,15 @@ func TestEncodeFullJSONDocument(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
cfg := DefaultEncoderConfig()
|
||||
cfg.Pretty = true
|
||||
enc, err := NewFormatEncoderWithConfig(cfg)
|
||||
require.NoError(t, err)
|
||||
|
||||
testutil.AssertEncoderAgainstGoldenSnapshot(t,
|
||||
testutil.EncoderSnapshotTestConfig{
|
||||
Subject: s,
|
||||
Format: NewFormatEncoder(),
|
||||
Format: enc,
|
||||
UpdateSnapshot: *updateSnapshot,
|
||||
PersistRedactionsInSnapshot: true,
|
||||
IsJSON: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user