Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(formatters): add console duration formatter
- Loading branch information
Showing
3 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Specs loaded in 0.002s | ||
Finished in 0.004s | ||
|
25 changes: 25 additions & 0 deletions
25
specs/units/formatters/console/duration_formatter.spec.coffee
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 @@ | ||
DurationFormatter = spectacular.formatters.console.DurationFormatter | ||
|
||
describe DurationFormatter, -> | ||
fixture 'formatters/duration.txt', as: 'expected' | ||
|
||
given 'options', -> | ||
{ | ||
colors: false | ||
} | ||
|
||
given 'runner', -> | ||
{ | ||
options: @options | ||
loadStartedAt: { getTime: -> 0 } | ||
loadEndedAt: { getTime: -> 2 } | ||
specsStartedAt: { getTime: -> 0 } | ||
specsEndedAt: { getTime: -> 4 } | ||
} | ||
|
||
given 'formatter', -> new DurationFormatter @runner | ||
|
||
subject -> @formatter.format() | ||
|
||
itBehavesLike 'a formatter' | ||
|
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