0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/plugin-server/jest.config.js
Karl-Aksel Puulmann bd0305bf73
feat(plugin-server): use swc for running jest tests (#9832)
* feat(plugin-server): use swc for running jest tests

Every time we run jest tests, typescript is being compiled. This adds
~13-20s to _starting_ each test suite on my machine.

This change brings it down to 1s at the cost of only _transpiling_ the
code and not doing any typechecking.

The second overhead this fixes is for piscina: every worker thread
compiled its own code every time, speeding this up takes that from 4.4s
to under a second. See https://github.com/PostHog/posthog/pull/9777 for
original context

* Re-add ts-jest
2022-05-18 14:45:54 +03:00

11 lines
311 B
JavaScript

module.exports = {
transform: {
'^.+\\.(t|j)s$': ['@swc/jest'],
},
testEnvironment: 'node',
clearMocks: true,
coverageProvider: 'v8',
setupFilesAfterEnv: ['./jest.setup.fetch-mock.js'],
testMatch: ['<rootDir>/tests/**/*.test.ts', '<rootDir>/benchmarks/**/*.benchmark.ts'],
}