Skip to content

Commit

Permalink
feat: test in nested worker
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed Mar 27, 2022
1 parent 461ee0c commit 8834f8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/playground/worker/__tests__/worker.spec.ts
Expand Up @@ -52,7 +52,10 @@ test.concurrent.each([[true], [false]])('shared worker', async (doTick) => {
})

test('worker emitted', async () => {
await untilUpdated(() => page.textContent('.nested-worker'), 'pong')
await untilUpdated(
() => page.textContent('.nested-worker'),
'pong http://localhost:3000/iife/sub-worker.js?worker_file'
)
})

if (isBuild) {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/worker/sub-worker.js
@@ -1,5 +1,5 @@
self.onmessage = (event) => {
if (event.data === 'ping') {
self.postMessage('pong')
self.postMessage(`pong ${import.meta.url}`)
}
}

0 comments on commit 8834f8f

Please sign in to comment.