define promise first, so that promise === v test works correctly