1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Angular unit testing with Jest setup [duplicate]

Discussão em 'Angular' iniciado por Valentina Maronese, Novembro 6, 2024 às 06:22.

  1. Test suite failed to run

    TypeError: configSet.processWithEsbuild is not a function

    > 1 | import 'jest-preset-angular/setup-jest';
    | ^
    2 |


    I'm trying to set up the environment for the unit testing with Jest, but I'm still having this error.

    This is my jest.config.ts:

    module.exports = {
    preset: 'jest-preset-angular',
    setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
    testEnvironment: 'jsdom',
    moduleFileExtensions: ['ts', 'html', 'js', 'json', 'mjs'],
    transform: {
    '^.+\\.(ts|js|html)$': 'ts-jest',
    },
    modulePathIgnorePatterns: ['<rootDir>/node_modules/'],
    globalSetup: 'jest-preset-angular/global-setup',
    };


    and in my package.json I have:

    "jest": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "jest-preset-angular": "^14.2.4",
    "ts-jest": "^29.2.5",


    What is going wrong?

    Continue reading...

Compartilhe esta Página