-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print compact stats instead of verbose when no errors or warnings (#1254
- Loading branch information
Showing
5 changed files
with
43 additions
and
11 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
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
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,25 @@ | ||
module Test.Spago.Unit.Printer where | ||
|
||
import Prelude | ||
|
||
import Data.String (joinWith) | ||
import Dodo as Dodo | ||
import Spago.Psa.Output (initialStats) | ||
import Spago.Psa.Printer (renderVerboseStats) | ||
import Test.Prelude (shouldEqual) | ||
import Test.Spec (Spec) | ||
import Test.Spec as Spec | ||
|
||
spec :: Spec Unit | ||
spec = do | ||
Spec.describe "renderVerboseStats" do | ||
Spec.it "renders regular stats with all zeroes when there are no errors or warnings" do | ||
printDoc (renderVerboseStats initialStats) `shouldEqual` | ||
joinWith "\n" | ||
[ " Src Lib All" | ||
, "Warnings 0 0 0" | ||
, "Errors 0 0 0" | ||
] | ||
|
||
where | ||
printDoc = Dodo.print Dodo.plainText Dodo.twoSpaces |