optimized testScripts task implementation