Files
coder/site/jest.config.js
T
dependabot[bot] 8ee3e2c541 chore: bump chartjs-adapter-date-fns from 2.0.0 to 3.0.0 in /site (#5528)
* chore: bump chartjs-adapter-date-fns from 2.0.0 to 3.0.0 in /site

Bumps [chartjs-adapter-date-fns](https://github.com/chartjs/chartjs-adapter-date-fns) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/chartjs/chartjs-adapter-date-fns/releases)
- [Commits](https://github.com/chartjs/chartjs-adapter-date-fns/compare/v2.0.0...v3.0.0)

---
updated-dependencies:
- dependency-name: chartjs-adapter-date-fns
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* added transformer for esm

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kira Pilot <kira.pilot23@gmail.com>
2023-01-05 15:58:04 -05:00

70 lines
1.9 KiB
JavaScript

// REMARK: Jest is supposed to never exceed 50% maxWorkers by default. However,
// there seems to be an issue with this in our Ubuntu-based workspaces.
// If we don't limit it, then 100% CPU and high MEM usage is hit
// unexpectedly, leading to OOM kills.
//
// SEE thread: https://github.com/coder/coder/pull/483#discussion_r829636583
const maxWorkers = 2
module.exports = {
maxWorkers,
projects: [
{
globals: {
"ts-jest": {
tsconfig: "./tsconfig.test.json",
},
},
coverageReporters: ["text", "lcov"],
displayName: "test",
preset: "ts-jest",
roots: ["<rootDir>"],
setupFilesAfterEnv: ["./jest.setup.ts"],
transform: {
"^.+\\.tsx?$": "ts-jest",
"\\.m?jsx?$": "jest-esm-transformer",
},
testEnvironment: "jsdom",
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
testPathIgnorePatterns: ["/node_modules/", "/e2e/"],
transformIgnorePatterns: [
"<rootDir>/node_modules/@chartjs-adapter-date-fns",
],
moduleDirectories: ["node_modules", "<rootDir>/src"],
moduleNameMapper: {
"\\.css$": "<rootDir>/src/testHelpers/styleMock.ts",
},
},
{
displayName: "lint",
runner: "jest-runner-eslint",
testMatch: [
"<rootDir>/**/*.js",
"<rootDir>/**/*.ts",
"<rootDir>/**/*.tsx",
],
testPathIgnorePatterns: [
"/out/",
"/_jest/",
"jest.config.js",
"jest-runner.*.js",
],
},
],
collectCoverageFrom: [
// included files
"<rootDir>/**/*.ts",
"<rootDir>/**/*.tsx",
// excluded files
"!<rootDir>/**/*.stories.tsx",
"!<rootDir>/_jest/**/*.*",
"!<rootDir>/api.ts",
"!<rootDir>/coverage/**/*.*",
"!<rootDir>/e2e/**/*.*",
"!<rootDir>/jest-runner.eslint.config.js",
"!<rootDir>/jest.config.js",
"!<rootDir>/out/**/*.*",
"!<rootDir>/storybook-static/**/*.*",
],
}