-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
reset mime-types #124
Comments
Can be solved by #129 |
@Hypercubed you mean I should use https://github.com/Hypercubed/node-mime? |
Your use case (feel free to correct me) is that you would like an mime lookup instance that includes the default types, expand the default types using The main node-mime fork has two options:
This is an all or noting approach. # 1 includes the default types but since this is a singleton and addition definitions are global and cannot be reset. # 2 is a instance that you can expand with your types, destroy when done, then create a new instance. However, this instance lacks the default types. My suggestion in
Teardown between tests would mean creating a new instance. I will likely make my version of node-mime a separate module (perhaps |
I know it's been a while, my apologies. I like this idea for v2. I'll figure something out for v2. |
v2 is out. Edit: See comment below |
My apologies.
|
Just a note for anyone else coming across this issue. I needed to add the .json extension for webpack to find the types. |
I'm writing unit tests for ecstatic's new custom mime-type feature and can't do a proper teardown between tests due to a number of reasons. But the main one, that stops me right now, is that
mime
doesn't have a reset-mime-types function.I can do
mime = new mime.Mime();
but that doesn't load the default types.Could you add a reset-mime-types function, please?
The text was updated successfully, but these errors were encountered: