coverage-istanbul-loader icon indicating copy to clipboard operation
coverage-istanbul-loader copied to clipboard

Sourcemap get empty file with ts+karma

Open kibbon opened this issue 5 years ago • 1 comments

Seeing issues of istanbul-instrument-loader, I changed my depencies just got blank file: image Here if my config: karam.conf.js, use 'coverage-istanbul' reporter

 webpack: {
        mode: 'development',
        devtool: "inline-source-map",
        module: {
            rules: [
                {
                    test: /\.ts?$/,
                    // 指定源码位置
                    include: [path.join(__dirname, 'src')],
                    use: [
                        {
                            loader: "coverage-istanbul-loader",
                        },
                        {
                            loader: 'ts-loader',
                        },
                    ],
                    exclude: /node_modules/,
                }
            ],
        },
        resolve: {
            extensions: ['.ts', '.js', '.json']
        },
    },

tsconfig.json

 
{
  "compilerOptions": {
    "outDir": "./output",
    "target": "es2017",
    "module": "commonjs",
    "lib": ["es2015", "es2016", "es2017", "dom"],
    "allowJs": false,
    "jsx": "react",
    "declaration": true,
    "skipDefaultLibCheck": true,
    "skipLibCheck": true,
    "inlineSourceMap": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "noImplicitUseStrict": true,
    "noImplicitThis": true,
    "noUnusedLocals": false,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "baseUrl": ".",
  },
  "exclude": [
    "node_modules",
    "test",
    "lib"
  ]
}

The coverage report is not correct too: image Since I only tested 3 functional files, the right one is (using instrument-loader): image

kibbon avatar Jan 14 '20 09:01 kibbon

+1

ietabhi avatar Feb 06 '20 11:02 ietabhi