u3-utils
sets of utilities for ultrain
- ecc
- test
Installation
$ npm install u3-utils
var U3Utils = ;
wait()
Waits until the given time has expired and then resolves.
;
waitUntil()
Waits until the given predicate-function returns true. Throws if the optional timeout has passed before.
;
With timeout:
;
assertThrows()
Async-Form of assert.throws. Asserts that the given function throws with the defined error, throws if not.
// with error-type; // with error-text-flag; // assertThrows returns the error;
isPromise()
Returns true if the given value is a Promise
;
const is = U3Utils; // trueconst is = U3Utils; // false
promisify
Transforms the given value to a promise if it was no promise before.
const ensurePromise = U3Utils;// now you are sure this is a promiseensurePromise