(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestJSONOutput(t *testing.T) { |
| 52 | testIO, _, out, _ := iostreams.Test() |
| 53 | opts := Options{ |
| 54 | BundlePath: bundlePath, |
| 55 | Logger: io.NewHandler(testIO), |
| 56 | SigstoreVerifier: verification.NewMockSigstoreVerifier(t), |
| 57 | exporter: cmdutil.NewJSONExporter(), |
| 58 | } |
| 59 | require.Nil(t, runInspect(&opts)) |
| 60 | |
| 61 | var target BundleInspectResult |
| 62 | err := json.Unmarshal(out.Bytes(), &target) |
| 63 | |
| 64 | assert.Equal(t, "https://github.com/sigstore/sigstore-js", target.InspectedBundles[0].Certificate.SourceRepositoryURI) |
| 65 | assert.Equal(t, "https://slsa.dev/provenance/v1", target.InspectedBundles[0].Statement.PredicateType) |
| 66 | require.NoError(t, err) |
| 67 | } |
nothing calls this directly
no test coverage detected