Open tandrewnichols opened 10 years ago
Can you produce an example project, preferably of minimal size, that I can use to reproduce this? I can't really debug it just from your description.
I too had tests written using 0.3.0 of sandboxed-module but am unable to get them to run successfully using 1.0.1
Are there any changes to how I am supposed to use this sandboxed-module library in the version 1.0.1 compared with 0.3.0?
So, it might be that we now recursively sandbox by default. In that, either your tests are explicitly written in a way incompatible with that behavior, or we have bugs in that new feature.
To turn that off, use the singleOnly: true
options. (Huh, that's a weird name for an option.) Let me know if it works for you.
In any case, a small example project would again be extremely helpful. We don't want to cause regressions.
Sorry, I had actually forgotten about this issue, by virtue of working on something else. I'll see if I can put a gist together sometime soon.
Apologies for the very late reply. I have just tried the singleOnly: true
option as you suggested and yes this is the solution to my problem. Thank you very much for the assistance. Much appreciated.
I've always used 0.3.0 in the past, so maybe there's just some upgrade thing I'm missing, but using 1.0.1, some (at least) of my stubs are not working. I'm using this wrapper:
This is in spec/helpers, so the path part isn't the problem (it does try to load the module), but then it throws
[Error: Cannot find module 'ftoggleDir/.ftoggle.config'] code: 'MODULE_NOT_FOUND'
, but the console.log in the code above is logging (amongst other things):This is a json file, and I see that some of the recent improvements are around json files. I have tried it also with
.json
on the end. Is there something else I need to do to get 1.0.1 working?