-
Notifications
You must be signed in to change notification settings - Fork 2k
adding more client tests causes $location:nobase error #667
Comments
I encountered this on another project while writing tests for it, however, I fixed it by adding the following to the HTML page. However, this is already in the main layout html page on the 0.4.0 branch so I'm not sure why that would be failing.
|
Turns out this is caused by karma's default html file that is loaded without any base tag. node_modules\karma\static\context.html <head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head> looks like Karma has an upcoming fix to allow for custom context.html files so we can add our own custom context.html with a head tag when it's supported. In the meantime, I decided to add a test file that has a beforeAll which uses angular to add the base tag to the head. I figured this was the least invasive method, but am open to suggestions: modules\core\tests\client\core.client.tests.js beforeAll(function() {
angular.element(document.querySelector('head')).append('<base href="/">');
}); |
Hey guys -
Anyone know why I'm getting the following error:
when I add 2 more client tests?
Adding really simple tests (i.e. below) cause this error. Doesn't seem to matter what test file I add extra tests to, it always seems to throw this error when I add 2 more tests. Oddly, if I comment out one of the tests, the error is not thrown.
chat.client.controller.tests.js
I can get around the error by not requiring base in $locationProvider.html5Mode
Line 9 in init.js
But I'm not sure this is a recommended setting for production.
So, anyone have any ideas what's causing this nobase error? Or does anyone know if using requireBase:false is a bad idea for production?
The text was updated successfully, but these errors were encountered: