Skip to content

Commit 3eea850

Browse files
committed
fix: escape dot for TS_JS_TRANSFORM_PATTERN regex
1 parent 80d3e4d commit 3eea850

8 files changed

+17
-17
lines changed

e2e/enum/jest-compiler-cjs.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
1+
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
22

33
export default {
44
displayName: 'enum-compiler-cjs',
55
transform: {
6-
[TS_JS_TRANSFORM_PATTERN]: [
6+
[ESM_TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
99
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',

e2e/enum/jest-transpiler-cjs.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
1+
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
22

33
export default {
44
displayName: 'enum-transpiler-cjs',
55
transform: {
6-
[TS_JS_TRANSFORM_PATTERN]: [
6+
[ESM_TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
99
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',

e2e/transform-js/jest-compiler-cjs.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
1+
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
22

33
export default {
44
displayName: 'transform-js-compiler-cjs',
55
transform: {
6-
[TS_JS_TRANSFORM_PATTERN]: [
6+
[ESM_TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
99
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',

e2e/transform-js/jest-transpiler-cjs.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
1+
import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest'
22

33
export default {
44
displayName: 'transform-js-transpiler-cjs',
55
transform: {
6-
[TS_JS_TRANSFORM_PATTERN]: [
6+
[ESM_TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
99
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',

src/cli/__snapshots__/cli.spec.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports[`config init should create a jest config file with cli options for confi
4545
module.exports = {
4646
testEnvironment: "jsdom",
4747
transform: {
48-
"^.+.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
48+
"^.+\\.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
4949
},
5050
};"
5151
`;
@@ -55,7 +55,7 @@ exports[`config init should create a jest config file with cli options for confi
5555
export default {
5656
testEnvironment: "jsdom",
5757
transform: {
58-
"^.+.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
58+
"^.+\\.[tj]sx?$": ["ts-jest",{tsconfig:"tsconfig.test.json"}],
5959
},
6060
};"
6161
`;
@@ -99,7 +99,7 @@ exports[`config init should update package.json for config type js-with-ts-full-
9999
"version": "0.0.0-mock.0",
100100
"jest": {
101101
"transform": {
102-
"^.+.[tj]sx?$": [
102+
"^.+\\\\.[tj]sx?$": [
103103
"ts-jest",
104104
{
105105
"tsconfig": "tsconfig.test.json"
@@ -126,7 +126,7 @@ exports[`config migrate should generate transform config with existing transform
126126
exports[`config migrate should generate transform config with existing transform options for js-with-ts 1`] = `
127127
"module.exports = {
128128
transform: {
129-
'^.+.[tj]sx?$': [
129+
'^.+\\\\.[tj]sx?$': [
130130
'ts-jest',
131131
{},
132132
],

src/cli/cli.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe('config', () => {
330330
",
331331
"stdout": ""jest": {
332332
"transform": {
333-
"^.+.[tj]sx?$": [
333+
"^.+\\\\.[tj]sx?$": [
334334
"ts-jest",
335335
{
336336
"tsconfig": {
@@ -495,7 +495,7 @@ describe('config', () => {
495495
expect(res.stdout).toMatchInlineSnapshot(`
496496
"module.exports = {
497497
transform: {
498-
'^.+.[tj]sx?$': [
498+
'^.+\\\\.[tj]sx?$': [
499499
'ts-jest',
500500
{},
501501
],

src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const TS_TSX_REGEX = /\.[cm]?tsx?$/
55
export const JS_JSX_REGEX = /\.[cm]?jsx?$/
66
export const TS_TRANSFORM_PATTERN = '^.+\\.tsx?$'
77
export const ESM_TS_TRANSFORM_PATTERN = '^.+\\.m?tsx?$'
8-
export const TS_JS_TRANSFORM_PATTERN = '^.+.[tj]sx?$'
8+
export const TS_JS_TRANSFORM_PATTERN = '^.+\\.[tj]sx?$'
99
export const ESM_TS_JS_TRANSFORM_PATTERN = '^.+\\.m?[tj]sx?$'
1010
export const JS_TRANSFORM_PATTERN = '^.+.jsx?$'
1111
export const ESM_JS_TRANSFORM_PATTERN = '^.+\\.m?jsx?$'

src/presets/__snapshots__/create-jest-preset.spec.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ exports[`create-jest-preset CJS presets createJsWithBabelPreset should return pr
6363
exports[`create-jest-preset CJS presets createJsWithTsLegacyPreset should return preset config 1`] = `
6464
{
6565
"transform": {
66-
"^.+.[tj]sx?$": [
66+
"^.+\\.[tj]sx?$": [
6767
"ts-jest/legacy",
6868
{
6969
"isolatedModules": true,
@@ -77,7 +77,7 @@ exports[`create-jest-preset CJS presets createJsWithTsLegacyPreset should return
7777
exports[`create-jest-preset CJS presets createJsWithTsPreset should return preset config 1`] = `
7878
{
7979
"transform": {
80-
"^.+.[tj]sx?$": [
80+
"^.+\\.[tj]sx?$": [
8181
"ts-jest",
8282
{
8383
"isolatedModules": true,

0 commit comments

Comments
 (0)