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