Skip to content

Commit d409559

Browse files
committed
feat: remove getTsJestConfig function
1 parent 8cbf401 commit d409559

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

packages/vue2-jest/lib/utils.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ const getBabelOptions = function loadBabelOptions(filename, options = {}) {
6868
return loadPartialConfig(opts).options
6969
}
7070

71-
const getTsJestConfig = function getTsJestConfig(config) {
72-
const { ConfigSet } = require('ts-jest/dist/legacy/config/config-set')
73-
const configSet = new ConfigSet(config.config)
74-
var tsConfig = configSet.typescript || configSet.parsedTsConfig
75-
return {
76-
compilerOptions: { ...tsConfig.options, module: 'commonjs' }
77-
}
78-
}
79-
8071
/**
8172
* Load TypeScript config from tsconfig.json.
8273
* @param {string | undefined} path tsconfig.json file path (default: root)
@@ -173,7 +164,6 @@ module.exports = {
173164
throwError,
174165
logResultErrors,
175166
getCustomTransformer,
176-
getTsJestConfig,
177167
getTypeScriptConfig,
178168
getBabelOptions,
179169
getVueJestConfig,

packages/vue3-jest/lib/utils.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
const constants = require('./constants')
22
const loadPartialConfig = require('@babel/core').loadPartialConfig
3-
const {
4-
loadSync: loadTsConfigSync,
5-
resolveSync: resolveTsConfigSync
6-
} = require('tsconfig')
3+
const { loadSync: loadTsConfigSync } = require('tsconfig')
74
const chalk = require('chalk')
85
const path = require('path')
96
const fs = require('fs')
@@ -71,22 +68,6 @@ const getBabelOptions = function loadBabelOptions(filename, options = {}) {
7168
return loadPartialConfig(opts).options
7269
}
7370

74-
const getTsJestConfig = function getTsJestConfig(config) {
75-
const tsConfigPath = getVueJestConfig(config).tsConfig || ''
76-
const isUsingTs = resolveTsConfigSync(process.cwd(), tsConfigPath)
77-
if (!isUsingTs) {
78-
return null
79-
}
80-
81-
const { ConfigSet } = require('ts-jest/dist/legacy/config/config-set')
82-
const configSet = new ConfigSet(config.config)
83-
const tsConfig = configSet.typescript || configSet.parsedTsConfig
84-
// Force es5 to prevent const vue_1 = require('vue') from conflicting
85-
return {
86-
compilerOptions: { ...tsConfig.options, target: 'es5', module: 'commonjs' }
87-
}
88-
}
89-
9071
/**
9172
* Load TypeScript config from tsconfig.json.
9273
* @param {string | undefined} path tsconfig.json file path (default: root)
@@ -185,7 +166,6 @@ module.exports = {
185166
throwError,
186167
logResultErrors,
187168
getCustomTransformer,
188-
getTsJestConfig,
189169
getTypeScriptConfig,
190170
getBabelOptions,
191171
getVueJestConfig,

0 commit comments

Comments
 (0)