Skip to content

Commit

Permalink
fix: escape dot for JS_TRANSFORM_PATTERN regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Feb 22, 2025
1 parent 3eea850 commit 8c91c60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/cli/__snapshots__/cli.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`config init should create a jest config file with cli options for confi
module.exports = {
testEnvironment: "jsdom",
transform: {
"^.+.jsx?$": "babel-jest",
"^.+\\.jsx?$": "babel-jest",
},
};"
`;
Expand All @@ -35,7 +35,7 @@ exports[`config init should create a jest config file with cli options for confi
export default {
testEnvironment: "jsdom",
transform: {
"^.+.jsx?$": "babel-jest",
"^.+\\.jsx?$": "babel-jest",
},
};"
`;
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`config init should update package.json for config type js-with-babel-fu
"version": "0.0.0-mock.0",
"jest": {
"transform": {
"^.+.jsx?$": "babel-jest",
"^.+\\\\.jsx?$": "babel-jest",
"^.+\\\\.tsx?$": [
"ts-jest",
{
Expand Down Expand Up @@ -113,7 +113,7 @@ exports[`config init should update package.json for config type js-with-ts-full-
exports[`config migrate should generate transform config with existing transform options for js-with-babel 1`] = `
"module.exports = {
transform: {
'^.+.jsx?$': 'babel-jest',
'^.+\\\\.jsx?$': 'babel-jest',
'^.+\\\\.tsx?$': [
'ts-jest',
{},
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 JS_TRANSFORM_PATTERN = '^.+\\.jsx?$'
export const ESM_JS_TRANSFORM_PATTERN = '^.+\\.m?jsx?$'
// `extensionsToTreatAsEsm` will throw error with `.mjs`
export const TS_EXT_TO_TREAT_AS_ESM = ['.ts', '.tsx', '.mts']
Expand Down
4 changes: 2 additions & 2 deletions src/presets/__snapshots__/create-jest-preset.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`create-jest-preset CJS presets createDefaultPreset should return preset
exports[`create-jest-preset CJS presets createJsWithBabelLegacyPreset should return preset config 1`] = `
{
"transform": {
"^.+.jsx?$": "babel-jest",
"^.+\\.jsx?$": "babel-jest",
"^.+\\.tsx?$": [
"ts-jest/legacy",
{
Expand All @@ -46,7 +46,7 @@ exports[`create-jest-preset CJS presets createJsWithBabelLegacyPreset should ret
exports[`create-jest-preset CJS presets createJsWithBabelPreset should return preset config 1`] = `
{
"transform": {
"^.+.jsx?$": "babel-jest",
"^.+\\.jsx?$": "babel-jest",
"^.+\\.tsx?$": [
"ts-jest",
{
Expand Down

0 comments on commit 8c91c60

Please sign in to comment.