electricbookworks / electric-book

A Jekyll template for creating books in multiple formats
https://electricbookworks.github.io/electric-book
GNU General Public License v3.0
117 stars 45 forks source link

Add tests #69

Open arthurattwell opened 7 years ago

arthurattwell commented 7 years ago

We really need to add tests to our code. (Thanks, @SteveBarnett.)

When we create tests for PDF output, these Prince tests may be useful or instructive.

arthurattwell commented 7 years ago

@SteveBarnett I've found the simplest tests I use while developing new features are pages of content with tags on them. How about we create a standard admin/index.md or info/index.md in the Jekyll root, and on that index page we include a bunch of metadata tags, looping through site.html_pages in tables or lists.

This would let a user go to example.com/admin or example.com/info for a view of their book's details, which would also serve as a kind of health check.

SteveBarnett commented 7 years ago

@arthurattwell +1 on that. And a Front-end Style Guide that shows tiny examples of all the includes and usage (which is even better than "dry"docs)? The stuff in the EBW guide strike me as a good starting point.

Should we add a new issue "Add healthcheck page"?

arthurattwell commented 7 years ago

@SteveBarnett Great. New issue created at #89.

For the front-end styleguide, I'd prefer to link to the guide, so that we don't have documentation in different places. Or do you mean that's where one would document customisations that differ from the template?

SteveBarnett commented 7 years ago

@arthurattwell I've been thinking about this a bit more.

It's usual for the tests and the docs for a thing to live in the repo, with the stuff. For us, the tests for some of the liquid stuff will be the FESG: do our Liquid thingies render correctly? We could exclude the docs and tests from regular builds, maybe by having a configs/_config.test.yml. And maybe later adding automated testing (maybe DalekJS for checking that rendering.

I think I might be saying that we should roll [the EBW repo](https://github.com/electricbookworks/electric-book-workflow into this repo) into this repo... Shall we talk about this in-person and then paste some notes here?

arthurattwell commented 7 years ago

@SteveBarnett Interesting. That's how I used to have it set up: the guide was the template. I like the idea of the docs living in the repo, but I don't like the idea of filling someone's meta.yml with everything needed for guide, let alone typography. Let's chat offline and return.