CSL Discourse

Announce: a way to create test suites for CSL styles: jest-csl



Hi all,

I’m in the process of writing a big new style, and I made some tooling to make it easier. jest-csl is a way to do Test-Driven Development on CSL and CSL-M, by writing a specification for how your style should behave.

It takes your list of specs, and runs citeproc on all of them, collecting the results in an easy to use display. It can also spit out JSON of the completed test run, based on which you can write your own documentation generator. I hope it’s helpful to any style authors out there! There’s a mostly complete guide on how to use it in the README.

Three pictures, three thousand words:

  • A simple test case;
  • Some test output on the command line; and
  • Some documentation I generated, written as a React app (can’t share the source yet, but some of its components could be reusable for other projects):


Does not yet support testing <bibliography> output. If you need that, it won’t be difficult to add, just let me know.


Nice! I didn’t see your code for this until just now, which is a shame. Your structures would have been good discipline for the rewrite of the citeproc-js runner.