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