| Conditions | 3 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package timeago |
||
| 40 | func TestReadFile(t *testing.T) { |
||
| 41 | t.Run("readFile returns content of the file", func(test *testing.T) { |
||
| 42 | res := readFile("langs/en.json") |
||
| 43 | |||
| 44 | var js json.RawMessage |
||
| 45 | err := json.Unmarshal(res, &js) |
||
| 46 | |||
| 47 | if err != nil { |
||
| 48 | t.Errorf("Function readFile must return JSON object but %s returned", string(res)) |
||
| 49 | } |
||
| 52 |