Skip to content

Make "globalSetup" and "globalTeardown" work together with "transform" #5164

@opasno

Description

@opasno

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Modules defined in globalSetup and globalTeardown are not being transformed as defined in transform configuration entry.

What is the expected behavior?
Modules should be transformed.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

"jest": {
        "globalSetup": "<rootDir>/test/setup.ts",
        "globalTeardown": "<rootDir>/test/teardown.ts",
        "collectCoverage": true,
        "mapCoverage": true,
        "transform": {
            "^.+\\.ts?$": "ts-jest"
        },
        "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts)$",
        "moduleFileExtensions": [
            "ts",
            "js",
            "json",
            "node"
        ]
    }

jest 22.0.4
ts-jest 22.0.0
node 8.9.2
npm 5.5.1
OS Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions