MustJSONMarshal marshals the given value to JSON, and errors the test if it can not be turned into json.
(t testing.TB, v interface{})
| 946 | |
| 947 | // MustJSONMarshal marshals the given value to JSON, and errors the test if it can not be turned into json. |
| 948 | func MustJSONMarshal(t testing.TB, v interface{}) []byte { |
| 949 | b, err := JSONMarshal(v) |
| 950 | require.NoError(t, err) |
| 951 | return b |
| 952 | } |
| 953 | |
| 954 | // numFilesInDir counts the number of files in a given directory |
| 955 | func numFilesInDir(t *testing.T, dir string, recursive bool) int { |