Code Monkey home page Code Monkey logo

Comments (9)

sjelin avatar sjelin commented on June 3, 2024

Relative to your karma config file, where is healthCheckStatus.view.html?

from karma-redirect-preprocessor.

lordmat0 avatar lordmat0 commented on June 3, 2024

./karma-config.js

./src/main/app/components/healthcheck/healthcheckStatus.view.html
./src/main/app/components/healthcheck/healthcheckStatus.component.ts

The target path for these would be
app/component/healthcheck/

Setting the templareUrl to:
templateUrl: 'app/components/healthcheck/healthcheckStatus.view.html'
shows the component but the tests fail

If I change the template url to:
'src/main/app/components/healthcheck/healthcheckStatus.view.html'
the tests pass but the component fails to load (404)

from karma-redirect-preprocessor.

sjelin avatar sjelin commented on June 3, 2024

I think instead of prependPrefix you want stripPrefix

from karma-redirect-preprocessor.

lordmat0 avatar lordmat0 commented on June 3, 2024

Sorry for the delay I've not tried it yet but planning to this week. Once I do I'll let you know.

from karma-redirect-preprocessor.

rbnzdave avatar rbnzdave commented on June 3, 2024

So what happened here ? Been more than a month and I think I've got the same problem.

I'm at a loss as to what to use. the file itself, uses a template url as
templateUrl: './features/sidenav/sidenav.component.html'
the karma conf has

        preprocessors: {
            'app/**/*.html': ['redirect']
        },

and

        redirectPreprocessor: {
            // strip this from the file path
            stripPrefix: 'app/',
            // prepend this to the path
            prependPrefix: 'dev/',
        },

The actual path of the file i'm trying to test is
app/features/sidenav/sidenav.component.html
where "app" is in the same folder as the karma config.

Error kicked up when testing is
Failed: Failed to load features/sidenav/sidenav.component.html

from karma-redirect-preprocessor.

rbnzdave avatar rbnzdave commented on June 3, 2024

Ok got past it. we're also using defined plugins so I also needed to add the reference to the plugin in the config 'karma-redirect-preprocessor' (thing just wasn't loading at all), and the path having the problem was from grunt output so I had to strip a prefix of dev/.

from karma-redirect-preprocessor.

rbnzdave avatar rbnzdave commented on June 3, 2024

also note that you will need to do this for css files also.

from karma-redirect-preprocessor.

lordmat0 avatar lordmat0 commented on June 3, 2024

Hi we ended up with going with a different plugin that inlines them instead: https://github.com/ludohenin/gulp-inline-ng2-template

Thanks @sjelin though for this one and for the prompt responses 👍

from karma-redirect-preprocessor.

sjelin avatar sjelin commented on June 3, 2024

It sounds like everyone's solve their problems so I'm closing this

from karma-redirect-preprocessor.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.