@rsdk/jest 5.16.0-next.3 → 5.17.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.16.0](https://github.com/R-Vision/rsdk/compare/v5.16.0-next.3...v5.16.0) (2026-11-16)
7
+
8
+ **Note:** Version bump only for package @rsdk/jest
9
+
6
10
  ## [5.15.0](https://github.com/R-Vision/rsdk/compare/v5.15.0-next.14...v5.15.0) (2026-10-30)
7
11
 
8
12
  **Note:** Version bump only for package @rsdk/jest
@@ -0,0 +1,18 @@
1
+ const ts = require('typescript');
2
+
3
+ // ts-jest кеширует настройки на весь проект и не применяет allowJs для
4
+ // отдельного пути, поэтому ESM-only зависимости транспилируются здесь
5
+ module.exports = {
6
+ process(sourceText, sourcePath) {
7
+ const { outputText } = ts.transpileModule(sourceText, {
8
+ fileName: sourcePath,
9
+ compilerOptions: {
10
+ allowJs: true,
11
+ module: ts.ModuleKind.CommonJS,
12
+ target: ts.ScriptTarget.ES2022,
13
+ },
14
+ });
15
+
16
+ return { code: outputText };
17
+ },
18
+ };
package/jest.config.js CHANGED
@@ -1,13 +1,25 @@
1
- let prettierPath;
2
-
3
- try {
4
- // for work with jest snapshot
5
- prettierPath = require.resolve('jest-prettier');
6
- } catch {}
1
+ // Зависимости Fastify, которые поставляются только как ESM. Jest их не умеет
2
+ // загружать через require, поэтому их приходится транспилировать
3
+ const esmOnlyPackages = 'content-disposition|cookie';
7
4
 
8
5
  /** @type {import('ts-jest').JestConfigWithTsJest} */
9
6
  let config = {
10
- preset: 'ts-jest',
7
+ transform: {
8
+ '^.+\\.tsx?$': [
9
+ 'ts-jest',
10
+ {
11
+ // С `module: nodenext` ts-jest жалуется на hybrid module kind,
12
+ // полная проверка типов в тестах для этого не нужна
13
+ diagnostics: { ignoreCodes: [151002] },
14
+ },
15
+ ],
16
+ [`/node_modules/(${esmOnlyPackages})/.+\\.js$`]: require.resolve(
17
+ './esm-only.transformer',
18
+ ),
19
+ },
20
+ transformIgnorePatterns: [
21
+ `^(?!.*/node_modules/(${esmOnlyPackages})/).*/node_modules/`,
22
+ ],
11
23
  testEnvironment: 'node',
12
24
  testMatch: [
13
25
  '**/?(*.)+(spec|test).[jt]s?(x)',
@@ -15,8 +27,5 @@ let config = {
15
27
  ],
16
28
  setupFiles: ['dotenv/config'],
17
29
  };
18
- if (prettierPath) {
19
- config.prettierPath = prettierPath;
20
- }
21
30
 
22
31
  module.exports = config;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@rsdk/jest",
3
- "version": "5.16.0-next.3",
3
+ "version": "5.17.0-next.0",
4
4
  "description": "Jest configuration presets",
5
5
  "license": "ISC",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "peerDependencies": {
10
- "@types/jest": "^29.5.14",
11
- "jest": "^29.7.0"
10
+ "@types/jest": "^30.0.0",
11
+ "jest": "^30.4.0"
12
12
  },
13
- "gitHead": "1f97ab569e4605769856c6a2f7fe4a384f2afaa5"
13
+ "gitHead": "c65206299ce1f0f1e209bb936721a1537bc4a064"
14
14
  }