Skip to content

Conversation

@connorjclark
Copy link
Contributor

@connorjclark connorjclark commented Jul 6, 2022

ref testdouble/testdouble.js#491

Note: I am away from my windows machine so this is not yet verified. How can I configure the travis yml to run the tests on windows?

@connorjclark
Copy link
Contributor Author

connorjclark commented Jul 7, 2022

@searls I tried testing on windows but ran into too many issues.

  • yarn test:esm uses bash.. nbd so I just ran NODE_OPTIONS=--loader=quibble node ./test/esm-lib/teenytest-proxy.js './test/esm-lib/*.test.{mjs,js}' directly but that fails somewhere in teenytest-proxy.js ... which uses node require to run a bash script ?
  • then i tried NODE_OPTIONS=--loader=quibble sh node_modules/.bin/teenytest and got:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for C:\Users\cjamc\code\quibble\node_modules\teenytest\bin\teenytest
    at new NodeError (internal/errors.js:322:7)
    at defaultGetFormat (internal/modules/esm/get_format.js:71:15)
    at getFormat (file:///C:/Users/cjamc/code/quibble/lib/quibble.mjs:65:12)
    at Loader.getFormat (internal/modules/esm/loader.js:105:42)
    at Loader.getModuleJob (internal/modules/esm/loader.js:243:31)
    at async Loader.import (internal/modules/esm/loader.js:177:17)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

So I can't actually run the tests. Any advice on how to?

I gave it a spin with large number of tests that use testdouble, and do see some bugs still present so not ready to merge yet.

  • Looks like td.replace is also busted so I need to examine the commonjs usage too.
  • Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:

Some resources perhaps needed to reference for a proper fix.

@connorjclark
Copy link
Contributor Author

Managed to get the tests to run on windows. Added a script win:test:esm. But does require one small change in a dep:

image

@connorjclark connorjclark force-pushed the fix-win branch 3 times, most recently from 64a9660 to 4d5c313 Compare July 7, 2022 23:55
@connorjclark connorjclark marked this pull request as draft July 8, 2022 00:27
@searls
Copy link
Member

searls commented Jul 8, 2022

Thanks for continuing to work on this, I appreciate it. I won't be able to review for four or five days so feel free to keep pulling at this and polishing it

@searls
Copy link
Member

searls commented Jul 12, 2022

Hey @connorjclark, is there anything you need from me for next steps here? I'm back in town and technically own a Windows machine so I could try setting it up for win32 development if need be to verify manually

@connorjclark
Copy link
Contributor Author

My plan at the moment is to first try it out on our Lighthouse unit tests on Window, but I've got a few more things to do first before I'll be able to try that. I'll comment here when I've verified it works on a big set of tests, so I'd hold off on your own verification until then.

@searls
Copy link
Member

searls commented Feb 12, 2023

Hi @connorjclark, this was fixed in v0.6.16 thanks to @webstech's help! #89 (comment)

@searls searls closed this Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants