Closed roine closed 9 years ago
I get mine to work with keeping baseURL: "base"
I'll create a sample project and share it.
Just uploaded. You can get it form here: https://github.com/unional/karma-jspm-sample
jspm: {
serveFiles: [
'./.build/app/**/*.js'],
loadFiles: [
'./src/app/**/**.spec.js'
]
},
I have ./build/jspm_packages ./build/app/main - src files are in .build/app/*
my test srcs are in ./src/app/*/.spec.js
get
17 07 2015 19:40:41.905:WARN [web-server]: 404: /src/app/api/websql/websql.spec.js
17 07 2015 19:40:41.908:WARN [web-server]: 404: /src/app/transaction/transaction.service.spec.js`
System.config({
"baseURL": "/",
I can't set baseURL twice anymore.
I'm stuck with 404's on my specs now.
@jayudey-wf is there any work being done to fix our 404 issues? Seems to be an issue for multple people and setups.
Currently my UT's are broken even with @omerts fix.
@robertbaker try removing your baseURL
setting from config.js (letting karma-jspm set it for you) or set it to 'base'
I did.
I only have baseURL set in my package.json
it's set to .build
No difference
This project doesn't support having a custom baseURL at the moment. You would need to remove it from there as well. That is just not something we have ever needed to do based on our project structures.
I would like to add support for it, but with the inability to set baseURL more than once I'm not sure what the best approach is.
I'm now using karma-systemjs
instead of karma-jspm
and seems to be working fine. You can customize the baseURL there:
config.set({
...,
systemjs: {
configFile: "yourApp/config.js",
config: { baseURL: "testDir", ...}
}
});
@unional do you have to specify all of the jspm packages you are using in your unit tests + code. That's my main problem with it. I update stuff too often to keep changing the config with new version numbers.
You update the jspm packages as you would normally in your real config.js
file. in the karma.conf.js
you don't have to do that as it reads that config file as in systemjs: { configFile: "..." }
.
Maybe you can/should mention the baseURL: "/base/"
setting within the README? It did resolve my setup problems as well ...
Please follow #91 for updates on this issue
Karma gives me a 404,
The file is served at
/base/source/components/todotable/todotable.spec.js
, but JSPM is not adding the base prefix.Here's my JSPM config in package.json