Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise an error when report is empty (#214)
* Raise an error when report is empty * Add test :)
- Loading branch information
Ale Paredes
committed
Aug 22, 2017
1 parent
b2a60e4
commit 31c4ebd
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/codeclimate/test-reporter/formatters/clover" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_CoverageFormatter_Save_Fail_On_Empty_Report(t *testing.T) { | ||
r := require.New(t) | ||
a := CoverageFormatter{} | ||
a.In = &clover.Formatter{} | ||
a.In.Search("../formatters/clover/empty_example.xml") | ||
|
||
err := a.Save() | ||
r.Error(err) | ||
r.Equal("could not find coverage info for source files", err.Error()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<coverage generated="1493754316"> | ||
<project timestamp="1493754316"> | ||
<metrics files="13" loc="937" ncloc="722" classes="12" methods="49" coveredmethods="37" conditionals="0" coveredconditionals="0" statements="306" coveredstatements="148" elements="355" coveredelements="185" /> | ||
</project> | ||
</coverage> |