Comments (9)
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.
0.7.0 released.
from karma-typescript.
Does this issue influence the HTML result only being 'clickable' on some components, not all components?
from karma-typescript.
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.
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.
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.
That looks really strange... Could you post your Karma config here?
from karma-typescript.
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.
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.
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)
- Failed build under TypeScript 4.5.2 HOT 3
- `lcovonly` does not create `lcov.info`
- karma-typescript attempts to process `node_modules` TS by default config
- request: v5.5.3 release HOT 3
- Acorn parser Ecmaversion doesn't follow Typescript target HOT 2
- The process of Decorator has mistake make the PropertyDescriptor with undefined value
- 'karmaTypescriptConfig' does not exist in type 'ConfigOptions'
- error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. HOT 3
- Coverage report not showing files with zero coverage
- `browser` field of `package.json` not used?
- KarmaTypescript Thresholds not working on TS files rather taking coverage from JS files
- Avoid adding __esModule and default properties for JSON files loaded with require
- error TS18003: No inputs were found in config file 'tsconfig.json'
- Is karma-typescript compatible with Angular 13+ ?
- npm link karma
- Typescript 5 Integration HOT 7
- Add doc deprecation for karma-typescript with recommendations HOT 2
- Exports not define error on latest typescript version
- Error: No source found for .d.ts file
- Can't find sockjs-client/dist/sockjs
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 karma-typescript.