Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcemap get empty file with ts+karma #3

Open
kibbon opened this issue Jan 14, 2020 · 1 comment
Open

Sourcemap get empty file with ts+karma #3

kibbon opened this issue Jan 14, 2020 · 1 comment

Comments

@kibbon
Copy link

kibbon commented Jan 14, 2020

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

@ietabhi
Copy link

ietabhi commented Feb 6, 2020

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants