markdown-to-html-cli icon indicating copy to clipboard operation
markdown-to-html-cli copied to clipboard

JEST test support ES Module

Open jaywcjlove opened this issue 3 years ago • 1 comments

Not yet ready: jest cannot run tests correctly in ESM mode and mocking in our tests will need rework. It's possible to have jest convert everything to CJS, however ESM-only features (e.g. import.meta.url) will then fail instead.

Ref:

  • https://jestjs.io/docs/ecmascript-modules
  • https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/

Jest ESM support:

  • https://github.com/facebook/jest/issues/9430
  • https://github.com/nodejs/node/pull/31032
  • https://github.com/kulshekhar/ts-jest/issues/1174
  • https://github.com/kulshekhar/ts-jest/issues/1709
  • https://github.com/facebook/jest/issues/12183#issuecomment-1004320665

Code:

  • e6f29fb

Issue:

  • https://stackoverflow.com/a/50052194/1334703
  • https://nodejs.org/api/esm.html#esm_no_require_exports_module_exports_filename_dirname

jaywcjlove avatar Nov 24 '21 17:11 jaywcjlove

Upgrade v3.4.18

jaywcjlove avatar Aug 23 '22 04:08 jaywcjlove