Skip to content

Fix browserify test to work without errors in Node v10 #14

Open
@agilgur5

Description

@agilgur5

So in #13 I tried to upgrade CI to Node v10 Active LTS (v8 is EOL in January, lots of new features and performance in v10, npm ci, etc, etc) and that apparently caused the browserify test to start failing. I noticed this locally too, but didn't at all realize it was related to me updating my local Node version 😕

Per the Travis build, the error I'm getting is:

  /home/travis/build/agilgur5/physijs-webpack/build/browserify.bundle.js:100
    99:     if (options && options.bare) { return blob; }
   100:     var workerUrl = URL.createObjectURL(blob);   
   101:     var worker = new Worker(workerUrl);          
  Error thrown in test:
  TypeError {
    message: 'URL.createObjectURL is not a function',
  }

This is coming directly from the webworkify code and is seems like it's because jsdom has not implemented URL.createObjectURL, so it would make this a cantfix.

I have no clue why it works on Node v8 and fails on Node v10 though, that doesn't really make sense to me as that doesn't change the jsdom version and it's not implemented in any jsdom version. I'm guessing it might be silently failing and this might be why the browserify tests have the coverage issues found in #6, but idk.

Based on all the bugs encountered with workers / jsdom, I think it would make sense for this library to move to using something like cypress or a headless browser so that all the necessary features are implemented, and hopefully then the tests will pass without errors and code coverage will actually give some results.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions