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

Pls update istanbul-lib-instrument version #101

@kibbon

Description

@kibbon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions