javascript generator tests