Add test code for promises