Closed gsalisi closed 7 years ago
What's data
? Can't make sense of your example and exactly what's wrong here. If possible a runnable example is very helpful.
Sorry about that, I updated the names. I just want to verify that not stubbing a required file actually fetches the original required file. It doesn't seem to work for me.
bar.js
isn't a legal require statement unless you have an npm module called bar.js
. Should be ./bar.js
if it's a local file. Is that it?
I am requiring a local file. For this case let's pretend it is at app/js/bar.js
. This is getting stubbed to an empty object instead of using the original require.
Please update your original example then. It's not valid as is and I can't be sure what's going on if I don't know what you're running. Again, a runnable example is by far the fastest way for us to get you help.
I am using karma for running the tests with browserify with the following config:
config.set({
basePath : basePath,
frameworks: [ 'browserify', 'jasmine' ],
exclude: exclude,
files: files,
preprocessors: preprocessors,
browserify: {
debug: true,
plugin: [
['remapify', [{
src: '**/*.js',
expose: appName,
cwd: clientRoot + '/' + appName
}, {
src: '**/*.js',
expose: 'dxtest',
cwd: clientRoot + '/dxtest'
}, {
src: '**/*.js',
expose: 'dxcore',
cwd: clientRoot + '/dxcore'
}]],
'proxyquireify/plugin'
],
transform: [
['babelify', {
ignore: ['dxcore/lib/**/*.js'],
blacklist: ['es6.tailCall']
}]
],
watch: true
},
...
}
If none of this stands out to you as a cause to my issue, feel free to close this ticket and I will opt to not use this library. To clarify, the issue is it's not calling through unstubbed/uspecified files as expected.
Ok, I can't really make sense of what's going on. If you can't provide a runnable example it's too hard for me to diagnose.
foo.js
fooSpec.js
bar
infoo.js
is an empty object.bar
infooSpec.js
is the correct data.model
gets mocked to{ test: 'yay }
properlyWhy is it that bar is not calling through properly?