add JS test
fixed 'switch' statement on js