Closed denuko closed 6 months ago
Hi, thanks for the report
Crafty needs to set the environment variable for builds, and indeed, tests have different needs than builds.
I hardcoded
// Crafty configures its own environment for builds
// tests have different needs
process.env.NODE_ENV = "test";
right after initialize
I will release this soon but you can add it to your file in the meantime
Released Released in https://github.com/swissquote/crafty/releases/tag/v1.25.0
I tried the new release and it works great! Thanks a lot!
awesome, happy it works :)
Hello! After upgrading to crafty v1.24.0 and generating files with
crafty ide
, the following issue is happening specifically with jest.config.mjs:After generating and using the jest.config.mjs in IntelliJ integrated test run, the following error occurs
I reproduced that with crafty v1.24.0 and the newly generated jest.config.mjs. The test run was working fine with previous jest.config.js (generated by older crafty version).
I tried to add NODE_ENV=test in the configuration so that it's appended to the jest command, but it was not effective.
I did some console.log in jest.config.mjs to check NODE_ENV. Initially it's test, then changes to production after initialize()
Could you please look into that? Thanks!