Check out example codes for "create mock promise angular". It will help you in understanding the concepts better.

Code Example 1

return new Promise<string>(resolve => resolve(localStringValue));

Learn ReactJs, React Native from akashmittal.com