Skip to content

Commit

Permalink
test(module): update test for worker
Browse files Browse the repository at this point in the history
- Add conditional for onerror logging
- Update test condition

Ref naver#3333
  • Loading branch information
netil committed Aug 29, 2023
1 parent 69b76e9 commit ea4af92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/module/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export function runWorker(

// handle error
worker.onerror = function(e) {
console.error(e);
// eslint-disable-next-line no-console
console.error ? console.error(e) : console.log(e);
};

// return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion test/internals/boost-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("BOOST", () => {
this.timeout(4000);

it("check if given function run on WebWorker thread.", done => {
runWorker(true, function test_for_worker(p) {
runWorker(undefined, function test_for_worker(p) {
return `${p}_123`;
},
function(res) {
Expand Down

0 comments on commit ea4af92

Please sign in to comment.