2019-02-04 21:58:46 +01:00

14 lines
212 B
JavaScript

function then(fn) {
return async (value) => {
return fn(await value);
};
}
var result = 1
|> (async (x) => await x + 1)
|> then((x) => x + 1);
return result.then(val => {
expect(val).toBe(3);
});