mirror of
https://github.com/denoland/deno.git
synced 2024-12-28 18:19:08 -05:00
ee452ad883
* add "assertOps" test assertion which makes sure test case is not "leaking" ops - ie. after test finishes there are no pending async ops * apply "assertOps" to all tests in "cli/js/" * fix numerous tests leaking ops * document problem with edge case in "clearInterval" and "clearTimeout" implementation where they may leak async ops * move "cli/js/worker_test.ts" to "cli/tests/worker_test.ts" and run as integration test; workers leak ops because of missing "terminate" implementation
15 lines
315 B
JavaScript
15 lines
315 B
JavaScript
console.log("hello from test_worker_basic.js");
|
|
|
|
// TODO(bartlomieju): add test for throwing in web worker
|
|
if (self.name !== "jsWorker") {
|
|
throw Error(`Bad worker name: ${self.name}, expected jsWorker`);
|
|
}
|
|
|
|
onmessage = function(e) {
|
|
postMessage(e.data);
|
|
close();
|
|
};
|
|
|
|
onerror = function() {
|
|
return false;
|
|
};
|