Last active
December 13, 2019 21:36
-
-
Save isaacs/7c34832e7bc6d003d7980e2a2a99a4c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Domain = require('../..') | |
const create = name => Object.assign(new Domain(onerror(name)), {name}) | |
const onerror = name => (er, type) => console.error(`${name} ${type}:`, er) | |
const d1 = create(1) | |
Promise.reject('expect 1 - Promise.reject') | |
const d2 = create(2) | |
Promise.resolve().then(() => { | |
throw 'expect 2 - Promise.resolve(throw)' | |
}) | |
const d4 = create(4) | |
process.nextTick(() => { throw 'expect 4 - nextTick(throw)' }) | |
const d5 = create(5) | |
throw 'expect 5 - throw' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment