Skip to content

Commit

Permalink
kni-test: add compiledJson mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorbin committed Mar 4, 2021
1 parent e109259 commit 761a176
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion kni-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 761a176

Please sign in to comment.