var output = (function () { var exports = {}; var fs = require('fs'); var path = require('path'); function mkdir_p(path) { // This works like mkdir -p in Unix. try { fs.mkdirSync(path); } catch (e) { if (e.code !== 'EEXIST') { throw e; } } return path; } function make_output_dir() { mkdir_p('var'); var dir = mkdir_p('var/test-js-with-node'); return dir; } // TODO, move these actions with side effects to some kind // of init() function. var output_dir = make_output_dir(); var output_fn = path.join(output_dir, 'output.html'); var index_fn = path.join(output_dir, 'index.html'); exports.index_fn = index_fn; function stylesheets() { // TODO: Automatically get all relevant styles. // Note that we specifically do NOT use media.css here, // since we are focused on showing components in isolation. var data = ''; data += '\n'; data += '\n'; data += '\n'; data += '\n'; data += '\n'; data += '\n'; data += '\n'; data += '\n'; return data; } exports.start_writing = function () { var data = ''; data += stylesheets(); data += '\n'; data += '\n'; data += ''; data += '
Any test can output HTML to be viewed here:
\n'; data += 'Output of non-template.js testsThese are specifically from templates.js
\n'; fs.writeFileSync(index_fn, data); }; exports.write_test_output = function (label, output) { var data = ''; data += '