Comments (6)
I'm seeing this issue too on v1.1.1.
SystemJS under karma tries to load from /base/jspm_packages/ whereas my actual modules folder is at /www/jspm_packages/ as configured in package.json.
Seems like the SystemJS baseURL for karma-jspm is hard-coded atm: c14be8a
from karma-jspm.
All files served by karma's built-in server need to be prefaced with /base
as that is where it serves them from. The files being served must at least be included in serveFiles
or loadFiles
options.
If your jspm_packages are in /www/jspm_packages/
you will need to change your jspm packages configuration to www/jspm_packages/
directory like so:
jspm: {
packages: "www/jspm_packages/"
}
It will then make a request to /base/www/jspm_packages/
which should resolve correctly.
from karma-jspm.
Hi,
I do have this set in karma.conf.js:
jspm: {
packages: 'www/jspm_packages/',
loadFiles: [
'www/**/*-test.unit.js'
],
serveFiles: [
'www/**/*.js'
],
config: 'www/config.js'
},
But I still get
WARN [web-server]: 404: /base/jspm_packages/github/angular/[email protected]
when I do
import angular from 'angular';
in my test.
As a side note, the test completes properly when I change this from the generated www/config.js:
System.config({
"paths": {
...
"github:*": "jspm_packages/github/*.js"
}
});
to
System.config({
"paths": {
...
"github:*": "www/jspm_packages/github/*.js"
}
});
But then module loading in my application breaks down.
Looks like my issue has something to do with config.js being placed in a different location from karma.conf.js, and thus using different relative paths (and the jspm.packages config in karma.conf.js doesn't seem to be working?). Doesn't look like this is the case for Frikki though.
from karma-jspm.
Hi @lewisl9029,
I've just followed your config and it has help me very much, thanks! I found an solution latest problem, so you can set karma proxies to get it work without changing config.js. Somethink like this:
proxies: {
'/base/jspm_packages/': '/base/www/jspm_packages/'
}
Also, I want to ask @maxwellpeterson-wf are jspm.packages and jspm.config settings removed? I cant find it in issues but it seems to be true. It sounds so logical for me because package.json already has this configuration.
I'm not an node expert but does it possible to eliminate need for proxies with this package.json config too?
from karma-jspm.
@djindjic that proxy works for you? I have no idea why but I cannot get a proxy to a directory work at all. I always have to spin up another node server running on different port and use it as base. Like this: https://gist.github.com/capaj/8db4533c3a1cab1bf930
Could you post your full karma.conf.js?
from karma-jspm.
You can take a look to my jspm-sample project
I'm very interested to hear your opinion about my workflow if it works for you.
from karma-jspm.
Related Issues (20)
- The jasmine tests do not make the travis build fail
- 404 when using import HOT 8
- karma.error is not a function HOT 3
- Two more possible config files (jspm 0.17-beta.17) HOT 1
- Cannot start karma HOT 1
- karma v1.0.0: You need to include some adapter that implements __karma__.start method! HOT 22
- New test files not being run
- Add custom adapter option HOT 1
- Update "glob" dependency to 6 to get rid of negate behavior
- Only loading one test file
- SystemJS was not found HOT 3
- 404 when running tests on PhantomJS HOT 3
- 404: /base/jspm_packages/npm/@angular/[email protected]/testing.js HOT 8
- File not found (404) with the 0.17 beta 29 of JSPM HOT 2
- Only loading a subset of files HOT 2
- How to add System into Karma HOT 8
- karma tests returning 404
- Add support for SystemJS map configuration
- Console warning not necessary HOT 1
- 404 Error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-jspm.