PROBLEM Difficult to test SOLUTION Treat your Worker as a Function
test(‘transforms data’, async (assert) => { const worker = new Worker (‘transform.js’); const data = [1, 2, 3]; const result = postMessage(worker, data); assert.equal(result, I'm transformed!
); });
@TRENTMWILLIS
#JSKongress