Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CTAN error handling and fix non-svg 404 badges #922

Merged
merged 2 commits into from
Apr 13, 2017
Merged

Improve CTAN error handling and fix non-svg 404 badges #922

merged 2 commits into from
Apr 13, 2017

Conversation

paulmelnikow
Copy link
Member

Fix #921

I started work today on some vcr-style tests. They send requests to the server, record the responses to vendor requests, and then play the vendor requests back later. The library I'm using is a little buggy. The suite isn't ready for prime time. I'll add tests as I go. Hopefully there will be a meaningful amount of coverage by the time I've gotten the library under control.

I'm very open to input: https://github.com/paulmelnikow/shields-tests

These are the CTAN tests:
https://github.com/paulmelnikow/shields-tests/blob/master/vendor/ctan/spec.js

@paulmelnikow paulmelnikow added the bug Bugs in badges and the frontend label Mar 31, 2017
paulmelnikow added a commit to badges/shields-tests that referenced this pull request Mar 31, 2017
@paulmelnikow
Copy link
Member Author

After re-reading an old discussion thread (#411) I agree with @espadrine that tests should be geared toward problem detection. I do still want to push responsibility for testing from the reviewer to the contributor. However we can do that more simply than the approach I began to take. In particular we should hold off on vcr-style tests. Opened a discussion thread: #927.

@paulmelnikow paulmelnikow mentioned this pull request Apr 8, 2017
10 tasks
server.js Outdated
badgeData.text[1] = 'Unknown';
} else {
badgeData.text[1] = license;
if (license) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of implicit conversion to booleans in if / for / while statements, given that they can get counter-intuitive. Could you convert it to a check for a list, along with a check for the existence of at least one license?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, updated.

@espadrine espadrine merged commit 59ec4a4 into badges:master Apr 13, 2017
@paulmelnikow paulmelnikow added this to the Next Deploy milestone Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants