write testing for script event synchronization