Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Pls update istanbul-lib-instrument version #101

Open
kibbon opened this issue Jan 8, 2020 · 0 comments
Open

Pls update istanbul-lib-instrument version #101

kibbon opened this issue Jan 8, 2020 · 0 comments

Comments

@kibbon
Copy link

kibbon commented Jan 8, 2020

Recently I use karma+webpack+mocha+istanbul+typescript for js unit testing.
karma.conf.js

...
    preprocessors: {
        "test/*.spec.js": ['webpack'],
    },
    webpack: {
        mode: 'development',
        devtool: 'inline-source-map',
        module: {
            rules: [
                {
                    test: /\.ts?$/,
                    include: [path.join(__dirname, 'src')],
                    enforce: 'post',
                    use: [
                        {
                            loader: 'ts-loader',
                        },
                        {
                            loader: 'istanbul-instrumenter-loader',
                            options: {
                                esModules: true,
                                coverageGlobalScopeFunc: false,
                                coverageGlobalScope: '(new Function("return this"))()',
                            },
                        }
                    ],
                    exclude: /node_modules/,
                }
            ],
        },
        resolve: {
            extensions: ['.ts', '.js', '.json']
        },
    },
...

I received such error logs:

TS2339: Property 'hash' does not exist on type '{ path: string; statementMap: { '0': { start: { line: number; column: number; }; end: { line: number; column: number; }; }; '1': { start: { line: number; column: number; }; end: { line: number; column: number; }; }; '2': { start: { ...; }; end: { ...; }; }; ... 23 more ...; '26': { ...; }; }; ... 5 more ...; _covera...'.

And I found that this problem had been resolved by istanbuljs lib, but this repository still used old version.
Need to be resolved at once.

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

No branches or pull requests

1 participant