Giter Site home page Giter Site logo

Comments (9)

Bjeaurn avatar Bjeaurn commented on August 30, 2024 2

Yeah, that fixes it! It did require your latest branch to get working, so it seems to be all good once more.

Thanks again for your swift support and thanks for the great plugin. It has saved us and will keep preventing us from getting headaches.

from karma-typescript.

monounity avatar monounity commented on August 30, 2024

0.7.0 released.

from karma-typescript.

Bjeaurn avatar Bjeaurn commented on August 30, 2024

Does this issue influence the HTML result only being 'clickable' on some components, not all components?

from karma-typescript.

erikbarke avatar erikbarke commented on August 30, 2024

Hey @Bjeaurn, long time no see 😃 I've replaced the bundled version of remap-istanbul with the latest from npm, can you reproduce the error if you install from the latest dev branch, npm install https://github.com/monounity/karma-typescript.git#2.1.7?

from karma-typescript.

Bjeaurn avatar Bjeaurn commented on August 30, 2024

Hi @erikbarke, indeed it's been a while!

I've upgraded to the 2.1.7. tag, and saw a visual upgrade to the Istanbul coverage HTML result. However, I'm still unable to click all the components inside as they give me a 404.

I'll try to explain using screenshots, but I'm not completely certain that this issue and the one I'm describing are related or in any way related to the karma-typescript plugin.

Image.

As you can see; I've got quite a big coverage report, with good metrics. But when trying to click through to anything I get 404's. As you can see on the directory, it's only got app/index.html, instead of deeper linked files that give additional information on what's been targeted and covered or not.

from karma-typescript.

erikbarke avatar erikbarke commented on August 30, 2024

That looks really strange... Could you post your Karma config here?

from karma-typescript.

Bjeaurn avatar Bjeaurn commented on August 30, 2024

Of course!

module.exports = function (config) {
  config.set({

    frameworks: ["jasmine", "karma-typescript"],
    logLevel: config.LOG_INFO,

    files: [
      {pattern: 'app/assets/base.spec.ts'},
      {pattern: "app/assets/**/*.ts"}
    ],

    exclude: [
      "node_modules",
      "target/node-modules/webjars/",
      "node-modules"
    ],

    map: [
      {'moment': 'node_modules/moment/moment.js' }
    ],


    preprocessors: {
      "app/assets/**/*.ts": ["karma-typescript"]
    },

    exclude: [
      'app/assets/main.ts' // By excluding our main.ts we can initialize the TestBed. This is done through base.spec.ts as seen in the 'files' section.
    ],

    reporters: ["progress", "karma-typescript"],

    karmaTypescriptConfig: {
      tsconfig: './tsconfig.json',
      compilerOptions: {
        inlineSourceMap: true,
        module: "commonjs", // overrides tsconfig
        allowSyntheticDefaultImports: true
      },
      exclude: ["broken"],
      bundlerOptions: {
        ignoredModuleNames: ["react/addons"],
      },
      disableCodeCoverageInstrumentation: false,
      excludeFromCoverage: /\.(d|spec|test)\.ts/,
      remapOptions: {
        warn: function(message){
          console.log(message);
        }
      },
      reports:
      {
        "html": "coverage",
        "text-summary": ""
      },
      transformPath: function(filepath) {
        return filepath.replace(/\.(ts|tsx)$/, ".js");
      }
    },

    coverageReporter: {
      type : 'html',
      dir : 'coverage/'
    },

    browsers: ["Chrome"]
  });
};

from karma-typescript.

Bjeaurn avatar Bjeaurn commented on August 30, 2024

Additionally, I just noticed we've been getting this error after the 'Coverage report'

=============================== Coverage summary ===============================
Statements   : 58.38% ( 1704/2919 )
Branches     : 18.64% ( 104/558 )
Functions    : 33.48% ( 224/669 )
Lines        : 56.95% ( 1459/2562 )
================================================================================
18 01 2017 09:48:45.728:ERROR [reporter.karma-typescript]: Error: Unable to find entry for [app/assets/app/app-routing.module.ts]
    at MemoryStore.Store.mix.get (/Development/project-1/node_modules/istanbul/lib/store/memory.js:38:19)
    at HtmlReport.Report.mix.writeDetailPage (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:411:67)
    at /Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:489:26
    at SyncFileWriter.extend.writeFile (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.extend.writeFile (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)
    at HtmlReport.Report.mix.writeFiles (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:482:23)
    at /Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:484:22
    at Array.forEach (native)
    at HtmlReport.Report.mix.writeFiles (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:482:23)
    at HtmlReport.Report.mix.writeReport (/Development/project-1/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:566:14)
    at /Development/project-1/node_modules/remap-istanbul/lib/writeReport.js:64:22
    at new Promise (/Development/project-1/node_modules/core-js/modules/es6.promise.js:191:7)
    at writeReport (/Development/project-1/node_modules/remap-istanbul/lib/writeReport.js:40:11)
    at /Development/project-1/node_modules/karma-typescript/lib/reporter.js:91:32


from karma-typescript.

erikbarke avatar erikbarke commented on August 30, 2024

I think it's the inlineSourceMap: true that's tripping up the remapping, does it work if you replace that with sourceMap: true in the compilerOptions?

from karma-typescript.

Related Issues (20)

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.