Commit Graph

24 Commits

Author SHA1 Message Date
chris48s
bf53e612f5 [cdnjs gem] make exception classes more consistent (#1683)
make exception classes more consistent
2018-05-15 18:57:33 +01:00
Sam Lanning
4f8414c003 Add grade badge for [lgtm] (#1681)
* Add LGTM Grade badge

* Add new tests for LGTM Grade badge

* Add lgtm grade example to homepage
2018-05-12 10:30:48 +01:00
chris48s
b5635bf55a [gem cdnjs appveyor] refactor ruby gems service (#1680)
* allow services to export >1 classes

This change to loadServiceClasses() allows us to define
services which either export a single service class e.g:

module.exports = class Cdnjs extends BaseService {
  //...
}

or more than one. e.g:

module.exports = {
  GemVersion,
  GemDownloads,
  GemOwner,
  GemRank,
}

* refactor ruby gem badges

- move badge code to service classes
- throw exceptions for errors
- use let and const
- change tests to expect 'downloads' label for error badges
- general tidying

* fix typo in tests

* Don't always use class name in example label

This allows (for example) GemVersion and GemDownloads
both to use the example label 'Gem'
2018-05-10 17:32:45 +01:00
Pyves
3518b642e7 [MicroBadger] Fixed tests (#1677) 2018-05-07 21:47:36 +01:00
Sam Lanning
45ff94d5a3 Add [LGTM] service (#1672) 2018-05-05 19:14:58 +01:00
chris48s
8fcc13d5bc refactor [cdnjs] integration (#1668)
* pass error object to InvaildResponse()

this prevents us from throwing
TypeError: Cannot read property 'stack' of undefined
when we attempt to parse invalid json

* refactor [cdnjs] integration
2018-05-04 21:55:51 +01:00
chris48s
714df8fac5 change CC0 example in GH service tests (#1634) 2018-04-28 20:59:27 +01:00
Raul Riera
f607ad787e Add [buildkite] service (#1657)
* Support for buildkite

* Added to the examples as well

* Removed the unnecessary label property

* Fixed the example

* Improve the tests

* Made the branch optional and review suggestions

* Added network error test

* Unexpected response test

* PR review suggestions

* Updated test to include all responses

* Forgot one of the tests
2018-04-24 08:13:24 +12:00
Pyves
ac13fdb8d4 [librariesio] Missing try/catch block and tests (#1644) 2018-04-14 08:35:47 +01:00
Binh Bui
e1755df212 [vaadin-directory] Support star and stars endpoints (#1603) 2018-04-09 20:14:21 +01:00
Jacob Tomlinson
d56b6961da Add [dynamic-yaml] badge (#1623)
* Add dynamic yaml badge

* Forgot package lock

* Switch tests to yaml data source

* Add yaml to the dynamic badge maker options

* Reorder to match documentation examples

* Reordered dynamic types to be alphabetical

* Removed regex as pinend commit makes it unnecessary and fixed url

* Removed unused import

* Add more YAML MIME types

* Removed duplicate tests which don't differ between data types
2018-04-08 21:47:28 +02:00
Pyves
f98d17e00d [SourceForge] Fixes, tests and cleaning up (#1626) 2018-04-02 21:51:41 +01:00
Paul Melnikow
f2efd751b5 Minor refactor of examples preparation (#1632)
This cleans up the work from #1582, clarifying concerns, removing a bit of duplication, and renaming for clarity.
2018-04-02 07:03:52 -05:00
Pyves
a168072cd5 [DotnetStatus] Service deprecation (#1630) 2018-04-02 09:40:50 +01:00
Pyves
3aa21301ff [Ansible] Handle no data responses (#1629) 2018-04-02 09:38:25 +01:00
Paul Melnikow
416d433fa0 [appveyor] Error handling in BaseService (#1590)
Make a clear distinction between programmer errors ("internal errors") and runtime errors, and allow configuring the server to let the programmer errors bubble up in development and unit testing. This saves a huge amount of time because it generates ordinary stack traces when things go wrong. And, if these errors occur in production, we'll catch them, and display **shields | internal error** which is the equivalent of a 500 error.
2018-04-01 22:04:22 -05:00
Pyves
dd35739c5c [CodeClimate] Added missing try-catch block (#1613)
* Added missing try-catch block

* Added tests to cover malformed responses
2018-04-01 17:32:43 +02:00
Pyves
66c5d914c7 [CircleCI] Extended existing try-catch block (#1614) 2018-03-30 09:34:20 +01:00
Paul Melnikow
ac7c418222 Extract examples from new-style services (#1582)
Instead of centralizing examples, specify them from within a service.

* Avoid duplication in service loading + refactor
* Avoid duplication in URLs, rename uri -> url in BaseService
2018-03-30 03:07:44 -05:00
Pyves
ed419b0a77 [microbadger] Fix tests (#1600) 2018-03-27 11:15:51 +01:00
Paul Melnikow
ea4b758612 Move service tests alongside code (#1563)
Per discussion in #1543
2018-03-20 18:32:48 -07:00
Paul Melnikow
71ef474afc Add tests for BaseService + fix hex colors (#1581) 2018-03-20 15:04:55 -07:00
Paul Melnikow
0654abe2b2 Fix colors for new appveyor badge (#1583) 2018-03-19 20:16:47 -04:00
Paul Melnikow
2d651533aa New API for registering services: #963 #1423 #1425 #1450 #1451 #1544 #1543
This merges the `node-8` branch. The heavy lift was by @Daniel15 with refactoring from me and a patch by @RedSparr0w.

* New API for registering services (#963)
* Disable Node 6 tests on node-8 branch (#1423)
* BaseService: Factor out methods _regex and _namedParamsForMatch (#1425)
    - Adjust test grouping
    - Rename data -> queryParams, text -> message
* BaseService tests: Use Chai (#1450)
* BaseService: make serviceData and badgeData explicit and declarative (#1451)
* fix isValidStyle test (#1544)
* Run tests in Node 9, not Node 6 (#1543)
2018-03-11 17:53:01 -07:00