Highlighted

Unit testing with ExtendScript

New Here ,
Apr 02, 2020

Copy link to clipboard

Copied

Hi there,

did someone successfully implemented an unit testing workflow with ExtendScript in After Effects. I wonder if there's a proper way doing this?

I mean Adobe is using some test code in their Javascript SDK examples ("ColorSelector.jsx" it's taken from the ExtendedToolkit SDK), like:

 

 

/**
 "main program": construct an anonymous instance and run it
  as long as we are not unit-testing this snippet.
*/
if(typeof(ColorSelector_unitTest ) == "undefined") {
	new ColorSelector().run();
}

 

 

But there is no further indication or explanation how they are working with unit tests so far. 

Any ideas?

Thanks,
Peter

TOPICS
Scripting

Views

291

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Unit testing with ExtendScript

New Here ,
Apr 02, 2020

Copy link to clipboard

Copied

Hi there,

did someone successfully implemented an unit testing workflow with ExtendScript in After Effects. I wonder if there's a proper way doing this?

I mean Adobe is using some test code in their Javascript SDK examples ("ColorSelector.jsx" it's taken from the ExtendedToolkit SDK), like:

 

 

/**
 "main program": construct an anonymous instance and run it
  as long as we are not unit-testing this snippet.
*/
if(typeof(ColorSelector_unitTest ) == "undefined") {
	new ColorSelector().run();
}

 

 

But there is no further indication or explanation how they are working with unit tests so far. 

Any ideas?

Thanks,
Peter

TOPICS
Scripting

Views

292

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 02, 2020 0
Adobe Community Professional ,
Apr 02, 2020

Copy link to clipboard

Copied

Where is this snippet from?

You'd need to find a unit test library that's ES3 compatible for it to work in ExtendScript, or else write your own as far as I know.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 02, 2020 0
New Here ,
Apr 03, 2020

Copy link to clipboard

Copied

Hi Justin,

the snippet is from "ColorSelector.jsx" included from the ExtendedToolkit SDK. Most of the sample scripts provided in the SDK having a similiar code.

 

Writing my own framework is out of the question of the moment, so any suggestions what available unit test framework could be compatible?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 03, 2020 0
New Here ,
Apr 14, 2020

Copy link to clipboard

Copied

Find this project on github:

https://github.com/cobhimself/Before-Effects

It also includes a custom made test framework for ExtendScript. I didn't test it yet, but I'll give it a try soon.

Cheers.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2020 0