Browse Source

Update test script

master
Sven Slootweg 5 years ago
parent
commit
bc62f9d2ca
  1. 4
      test.js

4
test.js

@ -7,13 +7,13 @@ function promiseThatReturns(value) {
return Promise.resolve(value);
}
console.log(defaultValue(null, () => 4));
console.log(defaultValue(null, () => 4, {evaluate: true}));
console.log(defaultValue("foo", "bar"));
promiseTry(() => {
return Promise.all([
defaultValue.async(promiseThatReturns(undefined), promiseThatReturns(Infinity)),
defaultValue.async(() => promiseThatReturns("baz"), promiseThatReturns("qux"))
defaultValue.async(() => promiseThatReturns("baz"), promiseThatReturns("qux"), {evaluate: true})
]);
}).then((results) => {
console.log(results[0]);

Loading…
Cancel
Save