Last active
July 22, 2020 20:23
-
-
Save tshemsedinov/16dfc5d898848c79c0b4ac09225a6887 to your computer and use it in GitHub Desktop.
code 1 on assert
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
'use strict'; | |
// node 12.14.0 | |
// node 14.3.0, 14.4.0, 14.5.0 | |
// node v15.0.0-pre | |
const assert = require('assert'); | |
const { Worker } = require('worker_threads'); | |
const worker = new Worker('./worker.js'); | |
worker.on('error', err => { | |
console.log({ err }); | |
}); | |
worker.on('exit', code => { | |
console.dir({ code }); | |
}); | |
// Uncomment to get { code: 0 } on exit | |
// throw new Error('Workers, peasants, we are...'); | |
// Uncomment to get { code: 1 } on exit | |
// assert(false); |
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
'use strict'; | |
setTimeout(() => { | |
console.log('hello'); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment