Towards webpack support
See original GitHub issueI’d like to offer an approach to make webpack-built projects easily testable. Right now I’m using the webpack alias babel plugin, but any special loaders are ignored, and that code cannot be tested without extracting it elsewhere.
Ava can watch globs, transpile, augment and run tests. Webpack can watch entries, use loaders, and run plugins.
To map one to the other, this would work I think:
- Generate entries from globs
- Make
ava-loader
to do the power-assert stuff and anything else necessary, perhaps after the regularbabel-loader
ran. - Make
ava-plugin
(much likestart-server-webpack-plugin
) to run Ava on all the entries- preferably from the memory fs that webpack maintains
So, the transpile/augment code would need to run in ava-loader
and the run code would need to run in ava-plugin
.
Does this seem like a correct approach? Is the code in such a state that ava-loader
and ava-plugin
would just run internal Ava API calls?
I don’t know of a project that allows you to run a script in a child from a webpack in-memory fs, but transpiling to a temp dir is certainly acceptable for me.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (8 by maintainers)
@glenndevenish yea it’s been removed. IIRC because it had gotten too outdated.
We could look at https://www.npmjs.com/package/@mzgoddard/jest-webpack for inspiration.