Commit Graph

11 Commits

Author SHA1 Message Date
Ang YC
f6357da8ee [Date] Relative date badge (#2244)
Close #749
2019-01-04 11:32:38 -05:00
Paul Melnikow
4a847d2b08 [AppVeyorTests] compact format and custom labels (#2000)
This picks up the work from #1321 on top of the work from #1940.

It allows the user to choose a compact tests format, or to override the labels with their own text or symbols.
2018-09-08 09:27:59 -07:00
Paul Melnikow
9007658fd0 Refactor and test [github] token persistence (#1863)
Ref #1848 #1205
2018-08-11 20:13:40 -04:00
Paul Melnikow
7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00
Pyves
1dff491a24 Added number support to version text formatter (#1620) 2018-03-29 10:08:23 -07:00
Paul Melnikow
ccb3eb8fdf Fix January unit test (#1417) 2018-01-03 20:37:35 -07:00
Pyves
7039e68018 Consistent version formatting (#1246)
Provide greater consistency for badges related to versions. Fix #1181.

- the `version` function in `color-formatters` was previously returning the colour of the badge, but also its text with a leading _v_. It was broken down into two separate functions and the text formatting part was moved to `text-formatters`, where it really belongs.

- unit tests were added for these two functions in `color-formatters.spec` and `text-formatters.spec`, using Sazerac.

- as discussed in #1181, the leading _v_ was omitted  for _xxxx-yy-zz_ date patterns. Any future exceptions can easily be added to the `ignoredVersionPatterns` pattern.

- the badge colour was previously switched to orange if a hyphen was found in the version string. This didn't seem ideal, instead pattern matching is done to find keywords such as `beta`, `alpha` or `snapshot`. Of course, this list can easily be extended.

- all badges related to versions now use the `versionText` and `versionColor` functions. There are a few rare exceptions, for instance in cases where the data returned by the service's API allows to figure things out without relying on any parsing/pattern matching (eg. `badgeData.colorscheme = prerelease ? 'orange' : 'blue';`, where `prerelease` is determined from an API's response).
2017-11-11 17:54:38 -05:00
Paul Melnikow
7ca2e97155 Use sazerac for our data-driven tests (#1228)
Sazerac is a library for data-driven tests, where a series of tests asserts that the return value of a function matches the expected value. It provides nice syntax for tightening this up.

https://hackernoon.com/sazerac-data-driven-testing-for-javascript-e3408ac29d8c

This converts our tests to use it, and replaces some similar home-grown code.

I fixed one bug I encountered along the way: mikec/sazerac#12.
2017-11-01 20:15:19 -04:00
Pyves
5a1e994296 Better test coverage of text formatters + fix thousand case (#1185) 2017-10-20 21:25:04 -04:00
Pyves
7fa38c3335 More precise star display with test (#1179) 2017-10-16 16:30:40 -04:00
Paul Melnikow
820b72c4c4 Always allow overriding the label (#1108)
Audit all the badges with test coverage, looking for badges which assign `badgeData.text[0]`.
2017-10-01 20:20:13 -04:00