Your example only has two possible outcomes (either returns 1 or 2) which means you should be using a structure that combines an (if:) macro with an (else:) macro. It also only uses the value of (either:) macro for a single purpose (as the condition) so where is no real need for the $either variable.
Try something like the following.
(if: (either: 1, 2) is 1)[
(set: $test to (prompt:"yes or no","no"))
]
(else:)[
(set: $test to (prompt:"black or white","white"))
]
note: Personally I would use the (random:) macro instead of (either:) because both of these macros works by generating a random number. The (random:) macro simply returns that random number, where as the (either:) macro uses that random number to determine which of the supplied items to return. In your particular use case (returning 1 or 2) the (either:) macro has to work a little harder to basically achieve the same result.
The following uses the (random:) macro, it looks very similar to the above (either:) TwineScript example.
(if: (random: 1, 2) is 1)[
(set: $test to (prompt:"yes or no","no"))
]
(else:)[
(set: $test to (prompt:"black or white","white"))
]