Skip to content

Migration Fails to Grab testMatch #2616

@Karl-EdwardJeanMehu

Description

@Karl-EdwardJeanMehu

🐛 Bug Report

After running the latest version of ts-jest with the config:migration command, the testMatch option is set to null despite its value in the config file, jest.config.js.

Expected behavior

The testMatch option in the migrated configuration should have the same value set in the jest.config.js file.

Pre-migration config:

module.exports = {
  clearMocks: true,
  collectCoverage: false,
  coverageProvider: "v8",
  preset: "ts-jest/presets/js-with-ts",
  testEnvironment: "node",
  testMatch: [
    "**/__tests__/**/*.(spec|test).[tj]s?(x)"
  ]
}

Post-migration ( from jest.config.js ) config:

Migrated Jest configuration:
module.exports = {
  clearMocks: true,
  collectCoverage: false,
  coverageProvider: 'v8',
  preset: 'ts-jest/presets/js-with-ts',
  testEnvironment: 'node',
  testMatch: null,
  testRegex: [],
}

Notice testMatch is set to null.

To Reproduce

Save pre-migration configs to jest.config.js file then run yarn ts-jest config:migrate jest.config.js

envinfo

System:
    OS: MacOS
    Node version: v14.15.3

Npm packages:
    jest: v26.6.3
    ts-jest: v26.5.6
    typescript: v3.9.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions