mock promise response angular code example Example: create mock promise angular return new Promise<string>(resolve => resolve(localStringValue));