Closed jtompkins closed 8 years ago
This is essentially #91. Since you are not changing your baseURL
to something custom, you can completely omit the baseURL
entry from config.js
and everything should work as expected. Part of the issue being discussed in #91 is that setting the baseURL
more than once doesn't seem to work. We have to set a different baseURL
because Karma insists on serving the project files with a /base/
prefix on all requested URLs.
If you remove this line from your config.js: baseURL: "/",
it should allow karma-jspm to set it to /base
during test runs. Since "/" is the default, it shouldn't negatively affect your app outside of test runs, either.
@maxwellpeterson-wf Yep, that works beautifully. Thank you for the very quick response! Unless you have any objections, I'm closing this issue, since it's a dup of #91.
I'm trying to get started with Karma and karma-jspm, so please forgive me if is is a dumb question. Basically, I can't get Karma to load any of my test files - it 404s. In case it's important, this issue is occurring on a Windows 8.1 PC.
In order to try and isolate what's happening, I created a new project with very little actual code. The structure looks like this:
My
package.json
file looks like this:My
config.js
file looks like this:Note that the
baseUrl
is set to/
, which is the JSPM default (as far as I can tell).My
karma.conf.js
file looks like this:As far as I can tell, this is basically what you get when you run
karma init
, with thekarma-jspm
changes added.There's only one source file (
simpleThing.js
), and it looks like this:The corresponding spec file looks like this:
Running my tests results in this error:
The problem appears to be that the file is being served with a
/base/
prefix, and karma-jspm isn't looking there.I do not want to modify my config.js file to make Karma work. I can make some forward progress by proxying my
/app
and/test
folders to/base/app
(etc), but when I do that, I still get an error because karma-jspm can't find the node_modules or jspm_modules folders.Not really sure where to go from here. I saw issue #91, but my baseUrl is the default value, so I wasn't sure if that error applied here. Does anyone have any ideas what I'm doing wrong here?