* Share data across worker threads * * @param {Object} data * @param {Object} options - set {local: true} to not share among workers
(data, options = {})
| 305 | * @param {Object} options - set {local: true} to not share among workers |
| 306 | */ |
| 307 | static share(data, options = {}) { |
| 308 | // Instead of using append which replaces the entire container, |
| 309 | // directly update the support object to maintain proxy references |
| 310 | Object.assign(container.support, data) |
| 311 | |
| 312 | // Track which keys were explicitly shared |
| 313 | Object.keys(data).forEach(key => container.sharedKeys.add(key)) |
| 314 | |
| 315 | if (!options.local) { |
| 316 | WorkerStorage.share(data) |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | static createMocha(config = {}, opts = {}) { |
| 321 | const mochaConfig = config?.mocha || {} |
no test coverage detected