Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(preprocessor): Lookup patterns once invoked #1341

Conversation

andersekdahl
Copy link
Contributor

Don't lookup the list of patterns of files to preprocess until the
preprocessor is called. This because patterns might be added after the
preprocessor is created, and those will be missed if the patterns are
looked up too early.

Closes #1340

Don't lookup the list of patterns of files to preprocess until the
preprocessor is called. This because patterns might be added after the
preprocessor is created, and those will be missed if the patterns are
looked up too early.

Closes karma-runner#1340
@maksimr
Copy link
Contributor

maksimr commented Mar 9, 2015

@andersekdahl Thanks

This because patterns might be added after the
preprocessor is created
, ...

Can you explain when such a case occurs

@andersekdahl
Copy link
Contributor Author

It's an issue when you're creating a plugin and you want to add a file that you also want to preprocess. That is, in your framework factory function, you add an entry to config.files and add an entry to config.preprocessors for that file. Because of this bug, the preprocessor is never run for the added file.

So this PR is perhaps not the best way forward for allowing this, but it's a very small, low-impact change. I'd much rather see some sort of stream-pipeline which you could push files through at any time, but I'm not familiar enough with the code base to propose such a change.

@maksimr
Copy link
Contributor

maksimr commented Mar 9, 2015

related issues
#1219

@dignifiedquire
Copy link
Member

LGTM

dignifiedquire added a commit that referenced this pull request Jun 4, 2015
…lookup

fix(preprocessor): Lookup patterns once invoked
@dignifiedquire dignifiedquire merged commit 22226ae into karma-runner:master Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List of patterns to preprocess are saved in a closure too early
3 participants