diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/026_workers.test | 2 | ||||
-rw-r--r-- | tests/026_workers.ts | 14 | ||||
-rw-r--r-- | tests/026_workers.ts.out | 4 | ||||
-rw-r--r-- | tests/error_004_missing_module (renamed from tests/error_004_missing_module.disabled) | 0 | ||||
-rw-r--r-- | tests/error_005_missing_dynamic_import (renamed from tests/error_005_missing_dynamic_import.disabled) | 0 | ||||
-rw-r--r-- | tests/error_006_import_ext_failure (renamed from tests/error_006_import_ext_failure.disabled) | 0 | ||||
-rw-r--r-- | tests/subdir/test_worker.js | 7 | ||||
-rw-r--r-- | tests/subdir/test_worker.ts | 7 |
8 files changed, 34 insertions, 0 deletions
diff --git a/tests/026_workers.test b/tests/026_workers.test new file mode 100644 index 000000000..1c5b6f4e6 --- /dev/null +++ b/tests/026_workers.test @@ -0,0 +1,2 @@ +args: tests/026_workers.ts --reload +output: tests/026_workers.ts.out
\ No newline at end of file diff --git a/tests/026_workers.ts b/tests/026_workers.ts new file mode 100644 index 000000000..0cf8f53b1 --- /dev/null +++ b/tests/026_workers.ts @@ -0,0 +1,14 @@ +const jsWorker = new Worker("tests/subdir/test_worker.js"); +const tsWorker = new Worker("tests/subdir/test_worker.ts"); + +tsWorker.onmessage = e => { + console.log("Received ts: " + e.data); +}; + +jsWorker.onmessage = e => { + console.log("Received js: " + e.data); + + tsWorker.postMessage("Hello World"); +}; + +jsWorker.postMessage("Hello World"); diff --git a/tests/026_workers.ts.out b/tests/026_workers.ts.out new file mode 100644 index 000000000..7538cc867 --- /dev/null +++ b/tests/026_workers.ts.out @@ -0,0 +1,4 @@ +Hello World +Received js: Hello World +Hello World +Received ts: Hello World diff --git a/tests/error_004_missing_module.disabled b/tests/error_004_missing_module index b94c86004..b94c86004 100644 --- a/tests/error_004_missing_module.disabled +++ b/tests/error_004_missing_module diff --git a/tests/error_005_missing_dynamic_import.disabled b/tests/error_005_missing_dynamic_import index 2acf467c1..2acf467c1 100644 --- a/tests/error_005_missing_dynamic_import.disabled +++ b/tests/error_005_missing_dynamic_import diff --git a/tests/error_006_import_ext_failure.disabled b/tests/error_006_import_ext_failure index 5fe245739..5fe245739 100644 --- a/tests/error_006_import_ext_failure.disabled +++ b/tests/error_006_import_ext_failure diff --git a/tests/subdir/test_worker.js b/tests/subdir/test_worker.js new file mode 100644 index 000000000..53d38ba96 --- /dev/null +++ b/tests/subdir/test_worker.js @@ -0,0 +1,7 @@ +onmessage = function(e) { + console.log(e.data); + + postMessage(e.data); + + workerClose(); +}; diff --git a/tests/subdir/test_worker.ts b/tests/subdir/test_worker.ts new file mode 100644 index 000000000..53d38ba96 --- /dev/null +++ b/tests/subdir/test_worker.ts @@ -0,0 +1,7 @@ +onmessage = function(e) { + console.log(e.data); + + postMessage(e.data); + + workerClose(); +}; |