Add tests for promise support (#329)
Add promise support (close #329, close #1036)