lundi 22 décembre 2014

Can not use resolve.alias for JEST testing

I am using WebPack + React + Jest for my application and I have set resolve.alias = { app: "/path/to/app" } in my configuration file.


In React, I can use this path to do require("app/component") and obtain the file at "/path/to/app/component.js" correctly.


When running JEST tests this alias is not recognized, neither in the tests, nor for the imported modules. All of this works when running the app but not the tests with jest-cli.


Aucun commentaire:

Enregistrer un commentaire