Espruino/tests/test_promise7.js

10 lines
259 B
JavaScript

//http://forum.espruino.com/conversations/297505/#comment13375674
new Promise((x,y)=>x()).then(dev=>{
return new Promise((x,y)=>y("Uh-oh"));
}).then(s=>{
console.log("ok", s);
}).catch(e=>{
console.log("expected error", e);
result = e == "Uh-oh";
});