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

Allow for dynamic loading of dependencies not specified in files array #2966

Open
lastmjs opened this issue Mar 26, 2018 · 5 comments
Open

Comments

@lastmjs
Copy link

lastmjs commented Mar 26, 2018

As far as I understand it, I have to explicitly define all files in the files configuration array before they are allowed to be loaded into the browser...why is this necessary? I'm building a tool on top of karma, so I need to be able to dynamically allow tests to import all of their dependencies. Right now I cannot fetch or use ES Modules on files that are not explicitly defined in the files array, and I can imagine this becoming very cumbersome as the dependency graph of a file to test could be quite complex, visiting a variety of different paths that I might not know at build time.

@johnjbarton
Copy link
Contributor

Reopen if this is not a dup of #2684

@lastmjs
Copy link
Author

lastmjs commented Mar 27, 2018

Is the ES Modules support going to allow files to be requested from Karma's server that are not explicitly listed in the files array?

@johnjbarton
Copy link
Contributor

Why do you want that feature? Your original post said.... ES modules.

@lastmjs
Copy link
Author

lastmjs commented Mar 28, 2018

My original post mentions ES Modules as a means to load dependencies yes, but I also mentioned using fetch. The main point is that any dependency, no matter how it is loaded, by ES Modules or plain http requests, should be loadable without having to explicitly list the file in the files array. I'm getting around this right now by proxying everything to another development server, which works for me but I don't think should be necessary.

@johnjbarton
Copy link
Contributor

Ok, I'll reopen even though I don't really agree. Explicit lists help ensure that tests are reproducible. Having a test solution which allows tests to pass if and only if the file system contains some unspecified files means the tests cannot be reproduced.

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

No branches or pull requests

2 participants