Skip to content

Commit

Permalink
fix: escape dot for TS_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 80d3e4d commit 3eea850
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions e2e/enum/jest-compiler-cjs.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'

export default {
displayName: 'enum-compiler-cjs',
transform: {
[TS_JS_TRANSFORM_PATTERN]: [
[ESM_TS_JS_TRANSFORM_PATTERN]: [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
Expand Down
4 changes: 2 additions & 2 deletions e2e/enum/jest-transpiler-cjs.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'

export default {
displayName: 'enum-transpiler-cjs',
transform: {
[TS_JS_TRANSFORM_PATTERN]: [
[ESM_TS_JS_TRANSFORM_PATTERN]: [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
Expand Down
4 changes: 2 additions & 2 deletions e2e/transform-js/jest-compiler-cjs.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'

export default {
displayName: 'transform-js-compiler-cjs',
transform: {
[TS_JS_TRANSFORM_PATTERN]: [
[ESM_TS_JS_TRANSFORM_PATTERN]: [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
Expand Down
4 changes: 2 additions & 2 deletions e2e/transform-js/jest-transpiler-cjs.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'

export default {
displayName: 'transform-js-transpiler-cjs',
transform: {
[TS_JS_TRANSFORM_PATTERN]: [
[ESM_TS_JS_TRANSFORM_PATTERN]: [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
Expand Down
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 @@ -45,7 +45,7 @@ exports[`config init should create a jest config file with cli options for confi
module.exports = {
testEnvironment: "jsdom",
transform: {
"^.+.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
"^.+\\.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
},
};"
`;
Expand All @@ -55,7 +55,7 @@ exports[`config init should create a jest config file with cli options for confi
export default {
testEnvironment: "jsdom",
transform: {
"^.+.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
"^.+\\.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
},
};"
`;
Expand Down Expand Up @@ -99,7 +99,7 @@ exports[`config init should update package.json for config type js-with-ts-full-
"version": "0.0.0-mock.0",
"jest": {
"transform": {
"^.+.[tj]sx?$": [
"^.+\\\\.[tj]sx?$": [
"ts-jest",
{
"tsconfig": "tsconfig.test.json"
Expand All @@ -126,7 +126,7 @@ exports[`config migrate should generate transform config with existing transform
exports[`config migrate should generate transform config with existing transform options for js-with-ts 1`] = `
"module.exports = {
transform: {
'^.+.[tj]sx?$': [
'^.+\\\\.[tj]sx?$': [
'ts-jest',
{},
],
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ describe('config', () => {
",
"stdout": ""jest": {
"transform": {
"^.+.[tj]sx?$": [
"^.+\\\\.[tj]sx?$": [
"ts-jest",
{
"tsconfig": {
Expand Down Expand Up @@ -495,7 +495,7 @@ describe('config', () => {
expect(res.stdout).toMatchInlineSnapshot(`
"module.exports = {
transform: {
'^.+.[tj]sx?$': [
'^.+\\\\.[tj]sx?$': [
'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 @@ -5,7 +5,7 @@ export const TS_TSX_REGEX = /\.[cm]?tsx?$/
export const JS_JSX_REGEX = /\.[cm]?jsx?$/
export const TS_TRANSFORM_PATTERN = '^.+\\.tsx?$'
export const ESM_TS_TRANSFORM_PATTERN = '^.+\\.m?tsx?$'
export const TS_JS_TRANSFORM_PATTERN = '^.+.[tj]sx?$'
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?$'
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 @@ -63,7 +63,7 @@ exports[`create-jest-preset CJS presets createJsWithBabelPreset should return pr
exports[`create-jest-preset CJS presets createJsWithTsLegacyPreset should return preset config 1`] = `
{
"transform": {
"^.+.[tj]sx?$": [
"^.+\\.[tj]sx?$": [
"ts-jest/legacy",
{
"isolatedModules": true,
Expand All @@ -77,7 +77,7 @@ exports[`create-jest-preset CJS presets createJsWithTsLegacyPreset should return
exports[`create-jest-preset CJS presets createJsWithTsPreset should return preset config 1`] = `
{
"transform": {
"^.+.[tj]sx?$": [
"^.+\\.[tj]sx?$": [
"ts-jest",
{
"isolatedModules": true,
Expand Down

0 comments on commit 3eea850

Please sign in to comment.