From 761a176ccd614689d726805bca589e071bc934ca Mon Sep 17 00:00:00 2001 From: Joshua T Corbin Date: Tue, 2 Mar 2021 15:55:33 -0800 Subject: [PATCH] kni-test: add compiledJson mode --- kni-test.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/kni-test.js b/kni-test.js index 0f169f8..e11311b 100644 --- a/kni-test.js +++ b/kni-test.js @@ -87,6 +87,20 @@ function testDescribe(kniscript, descript, done) { }, done); } +function testCompiledJson(kniscript, transcript, done) { + withTempDir(transcript, function under(dir, fin) { + var outfile = dir + '/out'; + var jsonfile = dir + '/json'; + runArgs([kniscript, '-j'], jsonfile, function compileDone(err) { + if (err) { + fin(err); + return; + } + runArgs(['-J', jsonfile, '-v', transcript], outfile, fin); + }); + }, done); +} + function main() { fs.readdir('tests', function(err, files) { if (err) { @@ -130,8 +144,8 @@ function main() { // verification tests [ - // TODO also derive from files and/or reconcile with engine-test ['basic', testBasic], + ['compiledJson', testCompiledJson], ].forEach(function eachTestMode(testMode) { var testModeName = testMode[0]; var runTest = testMode[1];