@application-kit/testing 0.7.0 → 0.7.1
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,11 @@
|
|
|
1
1
|
# @application-kit/testing
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7698ce1: Peer-зависимость `graphql` принимает 17. E2e-конфиг `@application-kit/testing` направляет алиас `graphql` на файл, который отдаёт `require` из корня приложения, а не на CJS-вход: с graphql 17 нативный `require` во внешнем `mercurius` получает ESM-сборку, и прежний алиас давал второй экземпляр — правило запрета introspection молча пропускало `__schema`. Приложению без `graphql` алиас не ставится.
|
|
8
|
+
|
|
3
9
|
## 0.7.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.defineApplicationMutationConfig = exports.defineApplicationEndToEndConfig = exports.defineApplicationUnitConfig = void 0;
|
|
7
|
+
const node_module_1 = require("node:module");
|
|
7
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
9
|
const node_process_1 = __importDefault(require("node:process"));
|
|
9
10
|
const vite_1 = require("vite");
|
|
@@ -60,6 +61,17 @@ const PROJECTS_OF_CELL = {
|
|
|
60
61
|
client: [clientProject],
|
|
61
62
|
server: [serverProject],
|
|
62
63
|
};
|
|
64
|
+
const graphqlEntryOf = (root) => {
|
|
65
|
+
try {
|
|
66
|
+
return (0, node_module_1.createRequire)(node_path_1.default.resolve(root, 'package.json')).resolve('graphql');
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (Reflect.get(new Object(error), 'code') === 'MODULE_NOT_FOUND') {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
63
75
|
const unitCoverageScope = (cell, options) => ({
|
|
64
76
|
exclude: [...(cell === 'server' ? options.clientSources : []), ...(options.coverage.exclude ?? [])],
|
|
65
77
|
include: cell === 'client' ? options.clientSources : options.coverage.include,
|
|
@@ -79,9 +91,9 @@ const defineApplicationUnitConfig = (options) => {
|
|
|
79
91
|
};
|
|
80
92
|
exports.defineApplicationUnitConfig = defineApplicationUnitConfig;
|
|
81
93
|
const defineApplicationEndToEndConfig = (options) => {
|
|
82
|
-
const graphql =
|
|
94
|
+
const graphql = graphqlEntryOf(options.root);
|
|
83
95
|
return (0, vite_1.mergeConfig)(options.viteConfig, {
|
|
84
|
-
resolve: { alias: { graphql } },
|
|
96
|
+
...(graphql !== undefined && { resolve: { alias: { graphql } } }),
|
|
85
97
|
root: options.root,
|
|
86
98
|
test: {
|
|
87
99
|
...sharedTestOptions(options),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import process from 'node:process';
|
|
3
4
|
import { mergeConfig } from 'vite';
|
|
@@ -54,6 +55,17 @@ const PROJECTS_OF_CELL = {
|
|
|
54
55
|
client: [clientProject],
|
|
55
56
|
server: [serverProject],
|
|
56
57
|
};
|
|
58
|
+
const graphqlEntryOf = (root) => {
|
|
59
|
+
try {
|
|
60
|
+
return createRequire(path.resolve(root, 'package.json')).resolve('graphql');
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (Reflect.get(new Object(error), 'code') === 'MODULE_NOT_FOUND') {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
57
69
|
const unitCoverageScope = (cell, options) => ({
|
|
58
70
|
exclude: [...(cell === 'server' ? options.clientSources : []), ...(options.coverage.exclude ?? [])],
|
|
59
71
|
include: cell === 'client' ? options.clientSources : options.coverage.include,
|
|
@@ -72,9 +84,9 @@ export const defineApplicationUnitConfig = (options) => {
|
|
|
72
84
|
});
|
|
73
85
|
};
|
|
74
86
|
export const defineApplicationEndToEndConfig = (options) => {
|
|
75
|
-
const graphql =
|
|
87
|
+
const graphql = graphqlEntryOf(options.root);
|
|
76
88
|
return mergeConfig(options.viteConfig, {
|
|
77
|
-
resolve: { alias: { graphql } },
|
|
89
|
+
...(graphql !== undefined && { resolve: { alias: { graphql } } }),
|
|
78
90
|
root: options.root,
|
|
79
91
|
test: {
|
|
80
92
|
...sharedTestOptions(options),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@application-kit/testing",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Тестовая инфраструктура NestJS-приложений: шины CQRS, логгер, фейковый microservice, сборка web-приложения, Postgres в testcontainers, запуск e2e-приложения, изоляция окружения прогона, дешёвый bcrypt для unit-прогона, раскладка ячеек CI по проектам vitest и фабрики конфигов vitest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cqrs",
|