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

Coverage with Webpack not work #474

Open
Merynek opened this issue Apr 27, 2022 · 1 comment
Open

Coverage with Webpack not work #474

Merynek opened this issue Apr 27, 2022 · 1 comment

Comments

@Merynek
Copy link

Merynek commented Apr 27, 2022

I have this config:
It works but coverage is on test files only. So 100% :-)).
I need coverage only on .ts files, but I dont know how set preprocessor only to .ts files.

module.exports = function (config) {
    config.set({
        frameworks: ["jasmine", "webpack"],
        reporters: ['progress', 'coverage'],
        files: [
            {
                pattern: `${outputPath}/**/*`,     // <-- here
                watched: false,
                included: false
            },
            "./test/boot.spec.ts",
            "./src/app/**/*.ts", // *.tsx for React Jsx
            "./test/**/*.ts" // *.tsx for React Jsx
        ],
        preprocessors: {
            // add webpack as preprocessor
            'test/**/*.ts': ['webpack', 'coverage']
        },
        coverageReporter: {
            type : 'html',
            dir : '../coverage/Pico'
        },
        webpack: webpackConfig,
        browsers: ["Chrome"],
        logLevel: config.LOG_ERROR
    });
};

I try this:

module.exports = function (config) {
    config.set({
        frameworks: ["jasmine", "webpack"],
        reporters: ['progress', 'coverage'],
        files: [
            {
                pattern: `${outputPath}/**/*`,     // <-- here
                watched: false,
                included: false
            },
            "./test/boot.spec.ts",
            "./src/app/**/*.ts", // *.tsx for React Jsx
            "./test/**/*.ts" // *.tsx for React Jsx
        ],
        preprocessors: {
            // add webpack as preprocessor
            'test/**/*.ts': ['webpack'],
            "./src/app/**/*.ts": ['webpack', 'coverage']
        },
        coverageReporter: {
            type : 'html',
            dir : '../coverage/Pico'
        },
        webpack: webpackConfig,
        browsers: ["Chrome"],
        logLevel: config.LOG_ERROR
    });
};

But I got error: ultiple assets emit different content to the same filename on assets, bcs Loaded more than once.

Any Idea?

@dsilhavy
Copy link

dsilhavy commented Mar 4, 2024

Anyone figured this out?

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