estktap
tap(tape) wrapper for testing adobe extendscript
usage
The estktap
function takes 4 arguments:
estktap(message, jsx_script_path, is_a, targets)
-
message
String: Description -
jsx_script_path
String: Path to script to test -
is_a
Number, String, Boolean, Function: Comparitor -
targets
Array: (Optional) List of targets
version number needs to be specified in targets
[indesign-7.0,indesign-11]
see versions.json
example
script to test
- myfn.jsx
Myfn = thisMyfn || {}; // return Document page lengthMyfn{ ifdoc return docpageslength else return undefined }; // add new Page to DocumentMyfn{ ifdoc instanceof Document docpages; return doc;};
write test
- test.jsx (for testing myfn.jsx)
#target InDesign-70#include "../myfn.jsx" var doc = appdocumentslength===0? appdocuments : appactiveDocument;$; // must
You should append
$.write(xxx)
at end in extendscript code for the test, because it uses tap test as output.
create runner
- test.js (for running test.js)
var test = estktap = ; ;
run
$ node test.js
or
$ tape test.js
more examples
See example.js