* Basic version of commit-status badge added
* Support for case with no common ancestor
* Handle unknown branch
* Service tests with error responses
* Handle unexpected 404 responses from github
* Branch is a base
* Tests reordered
* Using not the newest commit in tests
* Test for checked commit identical with the newest commit in branch
* Code refactoring
* Example for Github commit merge status
* 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'
* 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
* 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
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.
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
This resolves the following error occurring in production:
```
TypeError: Cannot read property 'slice' of null
/home/m/shields/lib/suggest.js in twitterPage at line 63:31
const schema = url.protocol.slice(0, -1);
```
This resolves the following error occurring in production:
```
TypeError: Cannot read property 'slice' of null
/home/m/shields/lib/suggest.js in findSuggestions at line 40:33
const userRepo = url.pathname.slice(1).split('/');
```
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)
These tests should fail if something is accidentally changed that affects the SVG or JSON files. In the case of deliberate changes, we can update the snapshots.
* remove newlines from datauri
* update test, remove decode
* support multiline datauris
* replace whitespace before checking isDataUri
removed multiline support from regex
* prependPrefix set default as empty string
* update
* add service tests for NuGet v2 services
* fixup - test the correct endpoint
* remove superfluous try/catch blocks
* test the colors too
* use invalid json fixture
* Integrated Vaadin service to server.js & load age from color-formatters lib
* Added 8 tests for Vaadin services
* Added Vaadin badge to main page under Misc
* Used checkErrorResponse() and fix 404 test return value
* Removed maturity from URL field option
* Remove duplicate `age` module import
* Removed comment
* Changed several URI fields and fixed according tests
* Added a shield for calculating npm bundle sizes
* Fix linting errors
* Fixed badges for bundlephobia
* Remove un-required keywords
* Simplified handler based on feedback
* Use isFileSize for validation
* Convert camel-cased error codes to space separated ones
* Updated error format
* Fixed error formatting
* Renamed gzip to minzip
* Fixes lint error
* Remove test that times out
* refactor tests to make it more readable
* meaningless change
* use trim
* Fixed remaining CodeClimate badges
* Added explicit percentage keyword and dropped top level URL
* Merged the two badge handlers into one
* Removed trailing space
* Switched to "dash" URL style
* Reinstated top-level URL
* Swicthed to use letter as optional keyword
* Updated badge examples
* Cleaned up
* Changed badge label to technical debt
* Switched tests to more mainstream projects as previous ones were deleted
* Rearranged badge URLs and default formats
* Updated examples