I'm working on a big project that uses Karma + Mocha + TypeScript + Webpack in WebStorm.
In the karma.conf.js
I specify which files to process this way:
for (const filePaths of filesToTest) {
preprocessors[filePaths] = ['webpack', 'sourcemap']
}
preprocessors: {
...preprocessors
}
filesToTest
contains all the test files, which take a lot of time to compile with Webpack.
In WebStorm there is a small play button besides the test, that allows to just run that specified test:
Pressing this play button will compile all my test files taking a very long time, and then somehow WebStorm will just run the one test I need (its specified in the "files to test" part in the created run configuration).
So my question is: Is there a way in my karma.conf to "catch" this "files to test" parameter, so I could only preprocess the needed file (e.g. its an environment variable)?