testdouble / teenytest

A very simple, zero-config test runner for Node.js
MIT License
96 stars 14 forks source link

fix: use file URL for esm import and remove node version check #75

Closed webstech closed 1 year ago

webstech commented 1 year ago

The first commit does a little cleanup under the assumption import is always available now.

  1. maint: remove check for node esm support Currently supported node versions no longer need the check for esm import support.
  2. fix: use file URL for esm import The fully qualified path needs to be a URL type to work on Windows.

The fix addresses a problem found running the quibble CI for PR 89 on Windows.

The problem can be recreated on Windows by adding this test to package.json: "test:safe:esm": "cd example/esm-node && npm test -- test/lib/dog-test.mjs:10", The recreate was not added to this patch series in case a different implementation is preferred.

Tested on Windows on both cmd and bash 'shells'.