Files
Bubberstation/tgui/jest.config.js
Jeremiah d32693e5e6 Replaces babel with swc (#80310)
## About The Pull Request
Revival of #79943. I was not done with Babel. For some reason, swc was
running very high memory. It was the minifier. If we use our current,
only swapping out babel (the previous PR swapped the minifier AND
transpiler), we not only keep the memory usage down to current levels
but we **slash** TGUI build times. Look at these numbers!

<details>
<summary>Test environment / My specs</summary>

intel i7-13700kf 
32GB RAM
windows 11 
intel 660p m.2 SSD
asus 4080 TUF series

</details>

<details>
<summary>Benchmarks</summary>

### To perform these tests, build/install/compile once, then delete
everything in the tgui/.yarn/webpack folder and all files in tgui/public
**EXCEPT** tgui.html and tgui-polyfill.min.js

Babel is our CURRENT.

Build time 

![2](https://github.com/tgstation/tgstation/assets/42397676/05324a54-2230-4173-a443-ef2aaa82e034)
SWC is 64.36% faster than our current solution

Peak memory usage

![1](https://github.com/tgstation/tgstation/assets/42397676/ab84a91d-7e48-43f8-be1b-7b7b9b36f30a)

</details>

What's the catch? Do we need to use node_modules now? No!

## Why It's Good For The Game
Faster build tools!
## Changelog
N/A nothing player facing
2023-12-14 23:02:19 -08:00

16 lines
485 B
JavaScript

module.exports = {
roots: ['<rootDir>/packages'],
testMatch: [
'<rootDir>/packages/**/__tests__/*.{js,ts,tsx}',
'<rootDir>/packages/**/*.{spec,test}.{js,ts,tsx}',
],
testPathIgnorePatterns: ['<rootDir>/packages/tgui-bench'],
testEnvironment: 'jsdom',
testRunner: require.resolve('jest-circus/runner'),
transform: {
'^.+\\.(js|cjs|ts|tsx)$': require.resolve('@swc/jest'),
},
moduleFileExtensions: ['js', 'cjs', 'ts', 'tsx', 'json'],
resetMocks: true,
};