// Smoke test for index.html's renderers, run by render.sh when node is present.
//
// The viewer has no test harness and a TypeError in a renderer produces a blank
// panel, not an error anyone sees. This runs every view's render function
// against a DOM stub and fails loudly on the first throw. It checks that the
// renderers run over the real data, not that the result looks right.
//
// node docs/architecture/check_viewer.js [path/to/index.html]
const fs = require('fs');
const path = process.argv[2] || __dirname + '/index.html';
const src = fs.readFileSync(path, 'utf8');
const js = src.match(/