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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit 'Delete stubs from require cache when in noPreserveCache mode' breaks when using coffee script #124

Closed
liamqma opened this issue May 10, 2016 · 1 comment

Comments

@liamqma
Copy link

liamqma commented May 10, 2016

Hi maintainers 馃槃

The recent commit I think will break if using coffeescript along with '_preserveCache' set to be true.

The following code will not be able to resolve .coffee

var stubIds = Object.keys(stubs).map(function (stubPath) {
   return resolve.sync(stubPath, {
       basedir: dirname(id)
    })
});

Unless we explicitly set extension to include .coffee based on node-resolve docs

var stubIds = Object.keys(stubs).map(function (stubPath) {
   return resolve.sync(stubPath, {
       basedir: dirname(id),
       extensions: [ '.js', '.coffee' ]
    })
});

Cheers 鉂わ笍

@bendrucker
Copy link
Collaborator

Ah, interesting. Related to #122 but should be way easier to solve. Appreciate you doing most of the work!

I think I should be able to grab require.extensions and that CoffeeScript will add itself there.

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