craigburke / karma-gradle

Gradle Plugin for Running tests with Karma
Other
21 stars 11 forks source link

added support for functions #15

Open fmillone opened 8 years ago

fmillone commented 8 years ago

Hey @craigburke sorry it took me so long. I've tried another approach to this problem. What do you think?

example

 ngHtml2JsPreprocessor = [
        // the name of the Angular module to create
        moduleName: "templates",
        cacheIdFromPath: jsFunction("function(filepath) { return filepath.replace('grails-app/assets/javascripts', '').replace('/templates/', '/').replace('.tpl.html','.html') ; }")
    ]

generates =>

"ngHtml2JsPreprocessor": {
            "moduleName": "temoplates", "cacheIdFromPath": function (filepath) {
                return filepath.replace('grails-app/assets/javascripts', '').replace('/templates/', '/').replace('.tpl.html', '.html');
            }
migsar commented 8 years ago

Hello,

Are there any news about this? I thought about doing this just removing the double quotes around the value of cacheIdFromPath key after the json has been converted to string. I did that in about ten lines in the KarmaModuleExtension file. I think either way it would be a nice feature to have. So what do you think?