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

[Bug]: Default transform regex does not escape dot properly #4579

Open
nikwen opened this issue Oct 8, 2024 · 0 comments
Open

[Bug]: Default transform regex does not escape dot properly #4579

nikwen opened this issue Oct 8, 2024 · 0 comments

Comments

@nikwen
Copy link

nikwen commented Oct 8, 2024

Version

29.7.0

Steps to reproduce

  1. npm i -D jest typescript ts-jest @types/jest
  2. npx ts-jest config:init

Expected behavior

Regex in jest.config.js escapes dot properly, e.g. '^.+\\.tsx?$'.

Actual behavior

Regex is not escaped properly: '^.+.tsx?$'

Regexes are defined here:

export const TS_TRANSFORM_PATTERN = '^.+.tsx?$'
export const ESM_TS_TRANSFORM_PATTERN = '^.+\\.m?tsx?$'
export const TS_JS_TRANSFORM_PATTERN = '^.+.[tj]sx?$'
export const ESM_TS_JS_TRANSFORM_PATTERN = '^.+\\.m?[tj]sx?$'
export const JS_TRANSFORM_PATTERN = '^.+.jsx?$'
export const ESM_JS_TRANSFORM_PATTERN = '^.+\\.m?jsx?$'

Debug log

Irrelevant for this issue

Additional context

No response

Environment

System:
    OS: macOS 14.7
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 20.16.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.8.1 - /usr/local/bin/npm
  npmPackages:
    jest: 29.7.0 => 29.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant