Vojtěch's avatar

Laravel Mix 6 with Jest

Has anyone tried the way to set up a laravel mix 6 with jest? Including setting the testing env variable.

0 likes
2 replies
Sinnbeck's avatar

Set up what? Mix is for compiling js and css assets

Vojtěch's avatar

Thanks, for quick reply @sinnbeck. I apologize for the poorly formulated question. I'm a noob. I am asking because on another project with mocha and mix 5, the tests are run as follows:

    "scripts": {
        "test": "cross-env NODE_ENV=testing mochapack --webpack-config=node_modules/laravel-mix/setup/webpack.config.js --require tests/JS/setup.js 'tests/JS/*.spec.js'"
    }

Before tests are precompiled assets. For what reason? Is it necessary with jest?

Or that's enough with mix 6 and jest:

    "scripts": {
        "test": "jest"
    }

Please or to participate in this conversation.