A version of jasmine that works with Adobe ExtendScript. ExtendScript is a JavaScript variant that allows you to create and run scripts that extend Adobe's Creative Suite.
This has been developed and tested on Mac OS X 10.14.5 machine with Adobe InDesign CC 2019. All but the command line test/run
(described below) should work on other platforms.
This uses an old version of jasmine v2.5 since ExtendScript is so old.
Simply install it like any other npm package.
npm install jasminejsx
- Create a
test/spec
directory for your*Spec.jsx
files. - Create a custom
test/run.jsx
that will bootstrap your testing environment. You can run this through an InDesign Scripts panel if you linked it properly to the/Applications/Adobe InDesign CC 2019/Scripts/Scripts Panel/
directory.//Custom environment loads here. This should define a rootPath //@include '../index.jsx' //Create a new logger instance var logger = new Logger(rootPath+'/log/test.log'); //Run Jasmine $.evalFile(rootPath + '/node_modules/jasminejsx/test/run.jsx');
- If you want to be able to run these test from the command line, link to the
node_modules/jasminejsx/test/run
file. This currently only works with OSX machines as it uses JavaScript for automation to open InDesign and run the tests.ln -s ../node_modules/jasminejsx/test/run test/run
- Run all tests with
test/run
or specific tests withtest/run CalculatorSpec
.
npm test
or test/run
Output should look like:
me@host jasminejsx|master$ test/run
1|2019-10-17T12:47:80|INFO|***************************
2|2019-10-17T12:47:80|INFO|Jasmine ExtendScript Runner
3|2019-10-17T12:47:80|INFO|***************************
4|2019-10-17T12:47:81|INFO|Loading all specs in ~/projects/jasminejsx/test/spec
5|2019-10-17T12:47:84|INFO|53 specs, 0 failures, 51 pending specs
6|2019-10-17T12:47:85|INFO|Finished in 0.025 seconds
- Ensure tests pass.
- Update
package.json
version number npm install
to update package lock.- Update
CHANGELOG.md
with changes since last release. - Check them all into the repository.
npm publish
to deploy the release to npm.git tag -a <version> -m <version>; git push --tags