@application-kit/testing 0.3.0 → 0.4.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
@@ -1,5 +1,16 @@
1
1
  # @application-kit/testing
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - da305d9: `bootstrap/web` экспортирует `createFastifyAdapter` и `configureFastifyApplication` — адаптер с request-id и шаг настройки (cookie, хук `x-request-id`, `configure`, интерцептор ошибок, `ValidationPipe`); `createFastifyApplication` собирается из них. `buildWebApplication` из `testing` вызывает оба: в e2e теперь 422 на невалидный DTO, заголовок `x-request-id` и плагин cookie, как в проде.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [da305d9]
12
+ - @application-kit/bootstrap@0.2.0
13
+
3
14
  ## 0.3.0
4
15
 
5
16
  ### Minor Changes
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildWebApplication = void 0;
4
- const platform_fastify_1 = require("@nestjs/platform-fastify");
4
+ const web_1 = require("@application-kit/bootstrap/web");
5
5
  const testing_1 = require("@nestjs/testing");
6
6
  const nestjs_pino_1 = require("nestjs-pino");
7
7
  const test_query_runner_js_1 = require("./test-query-runner.js");
@@ -15,7 +15,8 @@ const buildWebApplication = async (importModules, overrides = [], options = {})
15
15
  builder.overrideProvider(override.provide).useValue(override.useValue);
16
16
  }
17
17
  const moduleFixture = await builder.compile();
18
- const app = moduleFixture.createNestApplication(new platform_fastify_1.FastifyAdapter());
18
+ const app = moduleFixture.createNestApplication((0, web_1.createFastifyAdapter)());
19
+ await (0, web_1.configureFastifyApplication)(app);
19
20
  app.useLogger(app.get(nestjs_pino_1.Logger));
20
21
  await app.init();
21
22
  return app;
@@ -1,4 +1,4 @@
1
- import { FastifyAdapter } from '@nestjs/platform-fastify';
1
+ import { configureFastifyApplication, createFastifyAdapter } from '@application-kit/bootstrap/web';
2
2
  import { Test } from '@nestjs/testing';
3
3
  import { Logger } from 'nestjs-pino';
4
4
  import { testQueryRunner } from './test-query-runner.js';
@@ -12,7 +12,8 @@ export const buildWebApplication = async (importModules, overrides = [], options
12
12
  builder.overrideProvider(override.provide).useValue(override.useValue);
13
13
  }
14
14
  const moduleFixture = await builder.compile();
15
- const app = moduleFixture.createNestApplication(new FastifyAdapter());
15
+ const app = moduleFixture.createNestApplication(createFastifyAdapter());
16
+ await configureFastifyApplication(app);
16
17
  app.useLogger(app.get(Logger));
17
18
  await app.init();
18
19
  return app;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@application-kit/testing",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Тестовая инфраструктура NestJS-приложений: шины CQRS, логгер, фейковый microservice, сборка web-приложения, Postgres в testcontainers, раскладка ячеек CI по проектам vitest и фабрики конфигов vitest",
5
5
  "keywords": [
6
6
  "cqrs",
@@ -57,6 +57,9 @@
57
57
  "test:mutation": "stryker run",
58
58
  "test:unit": "vitest run"
59
59
  },
60
+ "dependencies": {
61
+ "@application-kit/bootstrap": "^0.2.0"
62
+ },
60
63
  "devDependencies": {
61
64
  "@nestjs/common": "^11.2.7",
62
65
  "@nestjs/core": "^11.2.7",