Comments (7)
This is fixed - now the html2js preprocessor is configurable karma-runner/karma-ng-html2js-preprocessor@5b59ac6
In your karma.conf.js
, you can do:
karma.configure({
ngHtml2JsPreprocessor: {
stripPrefix: 'app/views'
}
});
You will however need to wait a bit to get this released... or use karma@canary channel...
from ng-directive-testing.
Thanks for the fix! I tried out canary but got banged up a little bit. I'll make due until stable is released.
from ng-directive-testing.
@bennick I got exactly the same problem. Does vojtajina's solution work for you? It doesn't work for me.
from ng-directive-testing.
@Rheaxu I believe it did at the time. These days I put template files directly in a /public
directly so that Rails routing is not involved in serving them. This fixes any issues Rails routing was causing, the templates are loaded faster, and it forces me to keep them simple.
from ng-directive-testing.
@bennick Actually, it worked. Maybe I misspelled something. Sorry! And thanks for your post, it saves my day!
from ng-directive-testing.
@Rheaxu Great to hear.
from ng-directive-testing.
My project folder is at var/www/apps/angular/myproject
And the templates are in the templates folder under myproject.
So the template url is specified in the directive is "/template/directive.html"
So in the karma config I've written
ngHtml2JsPreprocessor: {
stripPrefix: 'var/www/apps/angular/myproject',
moduleName: "my.templates"
},
And this config works. But I don't want to specify the full path to the project in the config because for some other environment this might change. But "myproject" folder will be always there.
So I tried with stripPrefix: '*/myproject',
But it didn't work.
Please tell me how I can fix it?
from ng-directive-testing.
Related Issues (9)
- Update this example to use the testacular html2js preprocessor HOT 4
- Unit Test Karma Jasmine SyntaxError: Parse error on "&" Angular Directive binding
- getting error [launcher] Error: SyntaxError: Unexpected token . while running protractor test
- karma error: Uncaught SyntaxError: Unexpected token < HOT 11
- Getting illegal token error HOT 4
- Testing directives that have a require: ^parentDirective HOT 1
- templateUrl testing HOT 6
- Using two-way binding on the directive attributes fails in testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-directive-testing.