Added some tests

This commit is contained in:
Angelos Chalaris
2018-01-28 16:28:54 +02:00
parent 5358f1b908
commit 06d7e04220
19 changed files with 257 additions and 33 deletions

8
test/attempt/attempt.js Normal file
View File

@@ -0,0 +1,8 @@
const attempt = (fn, ...args) => {
try {
return fn(args);
} catch (e) {
return e instanceof Error ? e : new Error(e);
}
};
module.exports = attempt