()
| 25 | } |
| 26 | |
| 27 | function parent() { |
| 28 | const test = common.mustCall((arg, name = 'worker', exit, error = null) => { |
| 29 | const w = new Worker(__filename); |
| 30 | w.on('exit', common.mustCall((code) => { |
| 31 | assert.strictEqual( |
| 32 | code, exit, |
| 33 | `wrong exit for ${arg}-${name}\nexpected:${exit} but got:${code}`); |
| 34 | console.log(`ok - ${arg} exited with ${exit}`); |
| 35 | })); |
| 36 | if (error) { |
| 37 | w.on('error', common.mustCall((err) => { |
| 38 | console.log(err); |
| 39 | assert.match(String(err), error); |
| 40 | })); |
| 41 | } |
| 42 | w.postMessage(arg); |
| 43 | }, testCases.length); |
| 44 | |
| 45 | testCases.forEach((tc, i) => test(i, tc.func.name, tc.result, tc.error)); |
| 46 | } |
no test coverage detected
searching dependent graphs…