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

Get rid of the "base" directory #1607

Open
tkrotoff opened this Issue Oct 5, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@tkrotoff

tkrotoff commented Oct 5, 2015

Following a question I've asked (without success) on the mailing-list few months ago: Why a directory named "base" is prepended to all the loaded files?

With Karma all files are inside a directory named "base". I don't see the need for this added complexity.

karma

In comparison, when using Jasmine directly (gulp-jasmine-browser or by writing my own SpecRunner.html), there is no "indirection": all files are loaded from the root directory => much easier, the way it should be.

gulp-jasmine-browser

  • I have to prepend "base" to my XHRs for them to work (or add "urlRoot: 'base'" to karma.conf.js => does not work anymore). I'm not the only one in this case: https://github.com/pizzapanther/Karma-Read-JSON/blob/v1.1.0/karma-read-json.js#L27.
  • This makes it difficult to run unit tests using both Karma and (original) Jasmine.
  • Also source maps don't work (I use TypeScript) when debugging my tests using Karma singleRun: true.
    In Chrome when I click on a .ts file, I get a 404 because Karma tries to fetch /base/Hello.spec.ts instead of /Hello.spec.ts.
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 22, 2015

+1, base is making things hard, especially interoperability with different test systems.

ghost commented Oct 22, 2015

+1, base is making things hard, especially interoperability with different test systems.

@victor-xiong

This comment has been minimized.

Show comment
Hide comment
@victor-xiong

victor-xiong Nov 12, 2015

+1, html page setup with karma 'base' will not be able to be open correctly by other web servers.

+1, html page setup with karma 'base' will not be able to be open correctly by other web servers.

@jcrben

This comment has been minimized.

Show comment
Hide comment
@jcrben

jcrben Nov 15, 2015

If nothing else, we should figure out what advantages (if any) the base prefix provides.

jcrben commented Nov 15, 2015

If nothing else, we should figure out what advantages (if any) the base prefix provides.

@jeremyroberts0

This comment has been minimized.

Show comment
Hide comment
@jeremyroberts0

jeremyroberts0 Dec 31, 2015

+1, this is a regular source of annoyance in XHR paths.

+1, this is a regular source of annoyance in XHR paths.

@jamesdanged

This comment has been minimized.

Show comment
Hide comment
@jamesdanged

jamesdanged Jul 12, 2017

Seems there is now an easy way to deal with this by using the "proxies" setting. See http://karma-runner.github.io/1.0/config/files.html >> Loading Assets.

Seems there is now an easy way to deal with this by using the "proxies" setting. See http://karma-runner.github.io/1.0/config/files.html >> Loading Assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment