Get rid of the "base" directory
See original GitHub issueFollowing 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.
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.
- 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:
- Created 8 years ago
- Reactions:14
- Comments:8 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1, this is a regular source of annoyance in XHR paths.
+1, html page setup with karma ‘base’ will not be able to be open correctly by other web servers.