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