Every line of 'mockresolvedvalueonce' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
22 export function mockResolvedValueOnce(mock, value) { 23 mock.mockImplementationOnce( 24 () => 25 new Promise(resolve => { 26 process.nextTick(() => resolve(value)) 27 }) 28 ) 29 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
6 public methodPromiseResolveWithValue(value: any) { return Promise.resolve(value); }
61 resolve(value) 62 { 63 this[kResolve](value); 64 }
10 resolve(value) { 11 this._resolve.call(this.promise, value) 12 }
19 function resolved(value){ 20 var def = deferred(); 21 def.resolve(value); 22 return def.promise; 23 }
13 export function mockRejectedValue(mock, value) { 14 mock.mockImplementation( 15 () => 16 new Promise((resolve, reject) => { 17 process.nextTick(() => reject(value)) 18 }) 19 ) 20 }
29 this._value = function setValue(...args: Array<any>): void { 30 const result: V = setterInvoker.invoke(args); 31 model.set(result) 32 notify() 33 }
59 function resolve(value) { 60 resolveOrReject(true, value); 61 }
66 function callResolveMap(value, key) { 67 this._result.set(key, value); 68 if (--this._rest === 0) { 69 this._promise._resolve(this._result); 70 } 71 }
14 resolve(value) { this._resolve(value) }