-
Notifications
You must be signed in to change notification settings - Fork 223
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
Webpack.resolve.alias parameters ignored during tests #168
Comments
@danielefenix i can't even find a |
Hi @MikaAK, thank you for your reply. Do not consider that repository but consider the following repository instead: Chrome 52.0.2743 (Linux 0.0.0) ERROR
Uncaught ReferenceError: define is not defined
at /home/daniele/Desktop/fenix-ui-filter.git/test/specs.js:1 when i try to run the Every comments or support are really appreciated. Thanks |
This seems like config issues |
Sorry for the +1, but I am having the same problem, resolve.alias is seemingly being ignored. |
Quick update, it was a config issue on my end, in my case |
Closing as this was config issues. @danielefenix feel free to reopen for the other issue if you deem necessary but it seems like a config issue. |
@jmcgoldrick I'm curious how your alias path in the
When I open up the I have no issues with the Any advice or ideas are welcome and greatly appreciated. I'm kinda stumped on this one at the moment. |
Hey @aghreed, everything in your two configs seems like it is correct and the In my scenario I was getting "module ... not found errors" are you getting those? It seems like your What does your karma-test-shim file look like? Mine is almost identical to that listed on the Angular docs site. I'm also not using any default exports, so for me it would be |
I'm having a similar issue with
but the spec in that file is green when karma actually runs it. Is it possible that this is an issue with the order of preprocessors in my |
Hm I also had the same problem, in my office I'm using Windows and everything was fine there, but at home on my Mac I started tests and got the same error resolve: {
alias: {
sinon: 'sinon/pkg/sinon.js',
common: path.join(__dirname, '/common/'),
test: path.join(__dirname, '/test/'),
server: path.join(__dirname, '/server/'),
mocks: path.join(__dirname, '/mocks/')
},
extensions: ['', '.js', '.jsx', '.json']
} So I thought there is something wrong because of different OS and voila I started my tests with sudo:
|
I would like to add a testing framework to the library I am working on.
In order to do so, I refactored my library and I introduced
webpack
andkarma-webpack
to built it and test it.The building process is working fine, but I cannot make the dependencies path resolution work during the test process phase.
The final goal of the refactoring is to have a optimized version of the library that do not include 3rd party libs in it, with the testing framework that reports the coverage state of the tests.
Given that I am quite new with this new technology any feedback/suggestion aside the issue itself is really appreciated.
Current behavior:
When the lib is built using
webpack
each dependency is correctly resolved based onwebpack.resolve.alias
params, when the tests run thewebpack.resolve.alias
params are ignored and the resolution fails.Error:
Project repo: https://github.com/FENIX-Platform/fenix-ui-bridge
Commands:
npm install
to install the project's 3rd party librariesnpm run build
to run internally webpack and build thedist
foldernpm test
to run the testsWebpack version: 1.13.2
Webpack Karma version: 1.8.0
Karma version: 1.2.0
Environment:: Linux
Browser: Chrome Version 52.0.2743.116 (64-bit)
The text was updated successfully, but these errors were encountered: