ColCh / jest-webpack

DEPRECATED! Jest preprocessor to make it usable with webpack. https://github.com/ColCh/jest-webpack/issues/6
MIT License
11 stars 2 forks source link

How to use with coffeescript? #2

Closed wmertens closed 9 years ago

wmertens commented 9 years ago

This seems to ignore the webpack config, so it doesn't know about custom loaders like coffeescript and less, or am I mistaken?

ColCh commented 9 years ago

You're right... Any thoughts on using webpack config? I think that adding new option to package.json (which points to config) will help with this a lot

wmertens commented 9 years ago

now that I think of it, wouldn't it be better to make jest a sort of loader for webpack? You'd have to require() the tests which may be a little tedious, but it could then run the test automatically if the test changes, and vice versa. Or even make the tests a second entry point, and they would point to their dependencies properly...

wmertens commented 9 years ago

@ColCh and if you could somehow load jest instead of running the binary, the tests could go a lot faster because it would have the full setup ready to run... That would be seriously awesome...

ColCh commented 9 years ago

This is exactly webpack's loader behaviour. This script works like karma-webpack. Unfortunately I can't keep Jest loaded because webpack is used here as preprocessor (which is wrong by design)

ColCh commented 9 years ago

As 0.2.0 it has possibility to load config for webpack. It's specified with jest-webpack-config package.json key. See test fixture for more info.

ColCh commented 9 years ago

Closing since resolved

wmertens commented 9 years ago

Cool thanks! I also realized that a jest-loader wouldn't work with webpack because it overrides require to provide mocks. Webpack would not be able to know which ones are mocked.

...unless the jest-loader keeps track of mocks of course... hmmm.

ColCh commented 9 years ago

Yes... That's another sort of problem. I think that should be implemented within jest-loader functionality.