mantis-free-react-admin-template icon indicating copy to clipboard operation
mantis-free-react-admin-template copied to clipboard

`yarn test` fails out of the box

Open twasink opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug Running the included tests using yarn test doesn't work. The tests as configured use an ESM-based theme, which jest/yarn isn't configured to use. If you change it to use a CJS-based theme, the tests fail.

To Reproduce

  • Create a new clone, and install using yarn
  • Run npx jest
  • Observe the failure message (included as an attachment)

If you then change src/utils/SyntaxHiglight.js to import react-syntax-highlighter/dist/cjs/styles/hljs (to get a CommonJS version), the tests now run, but do not pass. Again, see included failure message as an attachment

Expected behavior The tests should pass on a clean checkout, or should not be included.

Screenshots See attachments.

Desktop (please complete the following information): OS: Windows 11 Browser: N/A Version: Current checkout (1.2.0)

twasink avatar Feb 20 '24 05:02 twasink

esm_failure.txt cjs_failure.txt

Failures, as mentioned

twasink avatar Feb 20 '24 05:02 twasink

Hi,

theme does not provide test cases as in at this moment.

Regards.

phoenixcoded20 avatar May 27 '24 10:05 phoenixcoded20