use JS in createPatternsTestScriptlet