mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +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.AssertEncoderAgainstGoldenSnapshot(t,
|
||||||
testutil.EncoderSnapshotTestConfig{
|
testutil.EncoderSnapshotTestConfig{
|
||||||
Subject: s,
|
Subject: s,
|
||||||
Format: NewFormatEncoder(),
|
Format: enc,
|
||||||
UpdateSnapshot: *updateSnapshot,
|
UpdateSnapshot: *updateSnapshot,
|
||||||
PersistRedactionsInSnapshot: true,
|
PersistRedactionsInSnapshot: true,
|
||||||
IsJSON: true,
|
IsJSON: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user