diff options
author | carson <carson@leaddyno.com> | 2020-05-22 18:41:00 -0700 |
---|---|---|
committer | carson <carson@leaddyno.com> | 2020-05-22 18:41:00 -0700 |
commit | 08242c7fc52a5c2a9dfb98aec0d759290dea8522 (patch) | |
tree | df6b0c04fb01a62c7f0d6aa4ece01dceb505d392 /scripts | |
parent | e0aa8dec9acbee27b6baacca586ce0a7ddf618c4 (diff) | |
download | htmx-08242c7fc52a5c2a9dfb98aec0d759290dea8522.tar.gz htmx-08242c7fc52a5c2a9dfb98aec0d759290dea8522.zip |
include a generated index file in /test
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/www.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/scripts/www.js b/scripts/www.js index f60d9135..f2aa5664 100644 --- a/scripts/www.js +++ b/scripts/www.js @@ -3,12 +3,20 @@ var fs = require('fs-extra'); console.log(config.version) -var testRoot = "www/test/" + config.version; -fs.ensureDirSync(testRoot); -fs.copySync("node_modules/mocha/mocha.js", testRoot + "/node_modules/mocha/mocha.js"); -fs.copySync("node_modules/mocha/mocha.css", testRoot + "/node_modules/mocha/mocha.css"); -fs.copySync("node_modules/chai/chai.js", testRoot + "/node_modules/chai/chai.js"); -fs.copySync("node_modules/sinon/pkg/sinon.js", testRoot + "/node_modules/sinon/pkg/sinon.js"); -fs.copySync("test/", testRoot + "/test"); -fs.copySync("src/", testRoot + "/src"); -fs.copySync("src/htmx.js", "www/js/htmx.js");
\ No newline at end of file +var testRoot = "www/test/"; +var currentReleaseRoot = testRoot + config.version; +fs.ensureDirSync(currentReleaseRoot); +fs.copySync("node_modules/mocha/mocha.js", currentReleaseRoot + "/node_modules/mocha/mocha.js"); +fs.copySync("node_modules/mocha/mocha.css", currentReleaseRoot + "/node_modules/mocha/mocha.css"); +fs.copySync("node_modules/chai/chai.js", currentReleaseRoot + "/node_modules/chai/chai.js"); +fs.copySync("node_modules/sinon/pkg/sinon.js", currentReleaseRoot + "/node_modules/sinon/pkg/sinon.js"); +fs.copySync("test/", currentReleaseRoot + "/test"); +fs.copySync("src/", currentReleaseRoot + "/src"); +fs.copySync("src/htmx.js", "www/js/htmx.js"); + +var testHTML = "<html><body style='font-family: sans-serif'><h1>HTMX TESTS</h1><ul>\n" +fs.readdirSync(testRoot).reverse().forEach(function(file){ + testHTML += "<li><a href='/test/" + file + "/test'>" + file + "</a>\n" +}); +testHTML += "</ul></body>" +fs.writeFileSync(testRoot + "/index.html", testHTML); |