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 3, 2021
1 parent 563e613 commit db3143a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions kni-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,24 @@ function testBasic(kniscript, transcript, 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() {
[
['basic', testBasic],
['compiledJson', testCompiledJson],
].forEach(function eachTestMode(testMode) {
var testModeName = testMode[0];
var runTest = testMode[1];
Expand Down

0 comments on commit db3143a

Please sign in to comment.