question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get rid of the "base" directory

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:14
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
jeremyroberts0commented, Dec 31, 2015

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

1reaction
victor-xiongcommented, Nov 12, 2015

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove base path from file path
I am retrieving multiple files using an OpenFileDialog, and would like to remove the base folder from the path.
Read more >
Question about 'Remove Base Directory' - Daz 3D Forums
Remove Base Directory tells DS to stop using that location as a content directory - it won't show it in the Content Library...
Read more >
How to Remove a Directory in Linux {rm & rmdir Commands)
In this tutorial, learn how to remove a directory in Linux using the rm and rmdir commands in the terminal window, without using...
Read more >
Remove Directory in Linux: How to Delete Files and Folders
Use the rm -r command to remove non-empty directories. Before you remove a directory, you need to know the name of it. To...
Read more >
In Unix, how do I remove a directory? - IU KB - Indiana University
To remove a directory that is not empty, use the rm command with the -r option for recursive deletion. Be very careful with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found