builtwithelm
builtwithelm copied to clipboard
Add Tests for the Built Website
Would be cool if we could add some tests that'd make sure PRs that just add projects can be merged without breaking the site.
Something simple like:
projects.jsonis well formed- The image is 1000x800px
- The image is optimized
- ?Check
projects.jsonfor duplicate project names?
Maybe test that the Elm code compiles w/o errors or warnings while we're at it?
@prikhi I'm interested in tackling this, perhaps by using http://coala.io - it seems kind of perfectly suited for this. Would that be ok or would the additional dependency be bothersome? If I don't hear back from you I'll likely make a PR anyway... :D
Haven't used coala before but seems OK to me :+1: :sparkles:
I might have to write a custom bear to check the image size but it's easy. Do you do CI anywhere yet? Could run this on travis, should be easy
There's no CI for this repo atm, Travis is my usual go to.
I've added a test for duplicate project names in projects.json - there were three, and I renamed them to specify the author after the project name
getting the image size is way harder than it should be because coala is rejecting raw files even though there's explicitly a setting to allow this. Do you know of a good image linter?
Dunno what is available on travis, but you could use identify from imagemagick:
identify -format "%wx%h" data/images/ABC-editor.jpg or just the file command w/ greps:
$ file ABC-editor.jpg | grep -oE "[^density] ([[:digit:]]+x[[:digit:]]+)" | grep -oE "\S+$"
1000x800
@knewter Thanks for tackling this project! This is a very welcome addition.