@akromio/doubles
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -129,2 +129,7 @@ /// <reference types="node" /> | ||
function rejects(value?: any): (...args: any[]) => Promise<any> | ||
/** | ||
* Similar to resolves(), but resolving with a given delay. | ||
*/ | ||
function sleep(delay: string | number, value?: any): (...args: any[]) => Promise<any> | ||
} | ||
@@ -131,0 +136,0 @@ |
@@ -93,2 +93,16 @@ "use strict"; | ||
}; | ||
simulator.fun.sleep = (delay, value) => { | ||
/* c8 ignore next */_core.dogma.expect("delay", delay, [_core.text, _core.num]); | ||
{ | ||
return createFunctionSimulator({ | ||
'invokes': async () => { | ||
{ | ||
0, await (0, _core.sleep)(delay); | ||
return value; | ||
} | ||
}, | ||
'default': true | ||
}); | ||
} | ||
}; | ||
simulator.constructor = simulator.fun; | ||
@@ -95,0 +109,0 @@ simulator.constructor.returns = simulator.fun.returns; |
{ | ||
"name": "@akromio/doubles", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Test doubles library.", | ||
@@ -53,3 +53,3 @@ "homepage": "https://akromio.com", | ||
}, | ||
"gitHead": "995b21d59a1f57f8489ee5044f96aa2592b28c4c" | ||
"gitHead": "fa4b5ba077b601b96fb7a69b42cc35ee4affe935" | ||
} |
74284
2200