Skip to content

Does this plugin work with Vite? #4

@AXeL-dev

Description

@AXeL-dev

Hello, i'm using this plugin with vite & ts-jest, still when running my tests i get the following error:

image

I'm using the following babel config:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react",
    "@babel/preset-typescript"
  ],
  "plugins": ["babel-plugin-transform-barrels"]
}

And the following jest config:

import { Config } from 'jest';

const config: Config = {
  testEnvironment: 'jsdom',
  testTimeout: 30000,
  transform: {
    '^.+\\.(t|j)sx?$': [
      'ts-jest',
      {
        tsconfig: 'tsconfig.test.json',
        babelConfig: true,
        useESM: true,
      },
    ],
  },
  setupFiles: ['<rootDir>/setup.jest.ts'],
  testPathIgnorePatterns: ['<rootDir>/node_modules/'],
  modulePathIgnorePatterns: ['<rootDir>/node_modules/'],
  testRegex: '(<rootDir>/src/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
 ...
};

export default config;

Is there anything missing in my config or maybe your plugin does only support webpack?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions