vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

fix(vue3-jest): compilation error while passing tsconfig path #446

Closed keuby closed 2 years ago

keuby commented 2 years ago

When the tsconfig path is not the default, I need to manually pass in the tsconfig path.Some configurations are shown below:

export default {
  globals: {
    'ts-jest': {
      tsconfig: require.resolve('./tsconfig.jest.json'),
    },
    'vue-jest': {
      tsConfig: require.resolve('./tsconfig.jest.json'),
    },
  },
}

The tsconfig#resolveSync method is called in the code to get the configuration. However, the configuration can't be obtained due to incorrect parameter passing, so it is compiled as JS code, resulting in compilation errors