Run tests for all web app packages in CI (#22579)

* Run tests for all web app packages in CI

* Test specific packages instead of all of them

* Revert back to using test-ci scripts and rely on Jest to count the number of CPU cores

* Revert more changes made to the web app CI tests

* Fix path to client package tests
Этот коммит содержится в:
Harrison Healey
2023-03-23 14:23:56 -04:00
коммит произвёл GitHub
родитель 56b18ca7bf
Коммит 9b5afb1b5f
6 изменённых файлов: 29 добавлений и 9 удалений

18
webapp/playbooks/jest.config.js Обычный файл
Просмотреть файл

@@ -0,0 +1,18 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/** @type {import('jest').Config} */
const config = {
moduleDirectories: ['src', 'node_modules'],
moduleNameMapper: {
'^@mattermost/(components)$': '<rootDir>/../platform/$1/src',
'^@mattermost/(client)$': '<rootDir>/../platform/$1/src',
'^@mattermost/(types)/(.*)$': '<rootDir>/../platform/$1/src/$2',
'^reselect$': '<rootDir>/../channels/src/packages/reselect/src',
'^src/(.*)$': '<rootDir>/src/$1',
},
testEnvironment: 'jsdom',
};
module.exports = config;

Просмотреть файл

@@ -126,7 +126,7 @@
"fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --fix --cache",
"test": "jest --forceExit --detectOpenHandles --verbose",
"test:watch": "jest --watch",
"test-ci": "jest --forceExit --detectOpenHandles --maxWorkers=2",
"test-ci": "jest --ci --forceExit --detectOpenHandles --maxWorkers=100%",
"check-types": "tsc -b",
"extract": "formatjs extract 'src/**/*.{ts,tsx}' --out-file i18n/temp.json --id-interpolation-pattern '[sha512:contenthash:base64:6]' && formatjs compile 'i18n/temp.json' --out-file i18n/en.json && rm i18n/temp.json",
"graphql": "graphql-codegen --config graphql_gen.ts",