@jongodb/memory-server 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -70,6 +70,13 @@ Your actual delta depends on test shape, I/O, and query workload.
70
70
  npm i -D @jongodb/memory-server
71
71
  ```
72
72
 
73
+ ## Module Format
74
+
75
+ This package supports both:
76
+
77
+ - ESM (`import`)
78
+ - CommonJS (`require`)
79
+
73
80
  ## Quick Start (Recommended)
74
81
 
75
82
  Use `createJongodbEnvRuntime` and keep one runtime per test process.
@@ -91,6 +98,14 @@ afterAll(async () => {
91
98
  });
92
99
  ```
93
100
 
101
+ CommonJS example:
102
+
103
+ ```js
104
+ const { createJongodbEnvRuntime } = require("@jongodb/memory-server/runtime");
105
+
106
+ const runtime = createJongodbEnvRuntime({ databaseName: "test" });
107
+ ```
108
+
94
109
  Behavior:
95
110
 
96
111
  - `setup()` starts launcher and writes `process.env.MONGODB_URI` (default)
@@ -0,0 +1,542 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startJongodbMemoryServer = startJongodbMemoryServer;
4
+ const node_child_process_1 = require("node:child_process");
5
+ const node_fs_1 = require("node:fs");
6
+ const node_module_1 = require("node:module");
7
+ const node_path_1 = require("node:path");
8
+ const node_readline_1 = require("node:readline");
9
+ const moduleRequire = (0, node_module_1.createRequire)((0, node_path_1.resolve)(process.cwd(), "__jongodb_module_resolver__.js"));
10
+ const READY_PREFIX = "JONGODB_URI=";
11
+ const FAILURE_PREFIX = "JONGODB_START_FAILURE=";
12
+ const DEFAULT_HOST = "127.0.0.1";
13
+ const DEFAULT_DATABASE = "test";
14
+ const DEFAULT_STARTUP_TIMEOUT_MS = 15_000;
15
+ const DEFAULT_STOP_TIMEOUT_MS = 5_000;
16
+ const DEFAULT_LAUNCHER_CLASS = "org.jongodb.server.TcpMongoServerLauncher";
17
+ const MAX_LOG_LINES = 50;
18
+ const BUNDLED_BINARY_PACKAGE_PREFIX = "@jongodb/memory-server-bin";
19
+ async function startJongodbMemoryServer(options = {}) {
20
+ const startupTimeoutMs = normalizeTimeout(options.startupTimeoutMs, DEFAULT_STARTUP_TIMEOUT_MS, "startupTimeoutMs");
21
+ const stopTimeoutMs = normalizeTimeout(options.stopTimeoutMs, DEFAULT_STOP_TIMEOUT_MS, "stopTimeoutMs");
22
+ const host = normalizeHost(options.host);
23
+ const port = normalizePort(options.port);
24
+ const databaseName = normalizeDatabaseName(options.databaseName);
25
+ const logLevel = options.logLevel ?? "silent";
26
+ const launchConfigs = resolveLaunchConfigs(options, {
27
+ host,
28
+ port,
29
+ databaseName,
30
+ });
31
+ const launchErrors = [];
32
+ for (let index = 0; index < launchConfigs.length; index += 1) {
33
+ const launchConfig = launchConfigs[index];
34
+ try {
35
+ return await startWithLaunchConfig(launchConfig, {
36
+ startupTimeoutMs,
37
+ stopTimeoutMs,
38
+ logLevel,
39
+ env: options.env,
40
+ });
41
+ }
42
+ catch (error) {
43
+ const normalized = wrapError(error);
44
+ launchErrors.push(`[${launchConfig.mode}:${launchConfig.source}] ${normalized.message}`);
45
+ }
46
+ }
47
+ throw new Error([
48
+ "Failed to start jongodb with available launch configurations.",
49
+ ...launchErrors,
50
+ ].join(" "));
51
+ }
52
+ async function startWithLaunchConfig(launchConfig, context) {
53
+ const child = (0, node_child_process_1.spawn)(launchConfig.command, launchConfig.args, {
54
+ stdio: ["ignore", "pipe", "pipe"],
55
+ windowsHide: true,
56
+ env: {
57
+ ...process.env,
58
+ ...context.env,
59
+ },
60
+ });
61
+ const stdoutLines = [];
62
+ const stderrLines = [];
63
+ let exitResult = null;
64
+ let stopped = false;
65
+ child.on("exit", (code, signal) => {
66
+ exitResult = { code, signal };
67
+ });
68
+ const stdoutReader = (0, node_readline_1.createInterface)({ input: child.stdout });
69
+ const stderrReader = (0, node_readline_1.createInterface)({ input: child.stderr });
70
+ const startupResult = await waitForStartup({
71
+ child,
72
+ stdoutReader,
73
+ stderrReader,
74
+ stdoutLines,
75
+ stderrLines,
76
+ startupTimeoutMs: context.startupTimeoutMs,
77
+ logLevel: context.logLevel,
78
+ launchDescription: `${launchConfig.mode}:${launchConfig.source}`,
79
+ }).catch(async (error) => {
80
+ await forceStopIfAlive(child, context.stopTimeoutMs);
81
+ throw wrapError(error);
82
+ });
83
+ const stop = async () => {
84
+ if (stopped) {
85
+ return;
86
+ }
87
+ stopped = true;
88
+ stdoutReader.close();
89
+ stderrReader.close();
90
+ if (exitResult !== null || child.exitCode !== null) {
91
+ return;
92
+ }
93
+ const terminated = child.kill("SIGTERM");
94
+ if (!terminated) {
95
+ if (exitResult !== null || child.exitCode !== null) {
96
+ return;
97
+ }
98
+ throw new Error("Failed to stop jongodb server process: unable to send SIGTERM.");
99
+ }
100
+ const gracefulExit = await waitForExit(child, context.stopTimeoutMs);
101
+ if (gracefulExit !== null) {
102
+ return;
103
+ }
104
+ const killed = child.kill("SIGKILL");
105
+ if (!killed) {
106
+ throw new Error("Failed to stop jongodb server process: SIGTERM timeout and SIGKILL failed.");
107
+ }
108
+ const forcedExit = await waitForExit(child, context.stopTimeoutMs);
109
+ if (forcedExit === null) {
110
+ throw new Error("Failed to stop jongodb server process: process did not exit after SIGKILL.");
111
+ }
112
+ };
113
+ if (child.pid === undefined) {
114
+ throw new Error("Jongodb process started without a PID.");
115
+ }
116
+ const detach = () => {
117
+ stdoutReader.close();
118
+ stderrReader.close();
119
+ child.stdout.destroy();
120
+ child.stderr.destroy();
121
+ child.unref();
122
+ };
123
+ return {
124
+ uri: startupResult.uri,
125
+ pid: child.pid,
126
+ detach,
127
+ stop,
128
+ };
129
+ }
130
+ function resolveLaunchConfigs(options, context) {
131
+ const mode = options.launchMode ?? "auto";
132
+ if (mode !== "auto" && mode !== "binary" && mode !== "java") {
133
+ throw new Error(`launchMode must be one of: auto, binary, java (got: ${mode}).`);
134
+ }
135
+ const binary = resolveBinaryCandidate(options.binaryPath);
136
+ const java = resolveJavaCandidate(options);
137
+ if (mode === "binary") {
138
+ if (binary === null) {
139
+ throw new Error([
140
+ "Binary launch mode requested but no binary was found.",
141
+ "Provide options.binaryPath or JONGODB_BINARY_PATH.",
142
+ bundledBinaryHint(),
143
+ ].join(" "));
144
+ }
145
+ return [toBinaryLaunchConfig(binary.path, binary.source, context)];
146
+ }
147
+ if (mode === "java") {
148
+ if (java === null) {
149
+ throw new Error([
150
+ "Java launch mode requested but Java classpath is not configured.",
151
+ "Pass options.classpath or set JONGODB_CLASSPATH.",
152
+ "Example (repo-local): ./.tooling/gradle-8.10.2/bin/gradle -q printLauncherClasspath",
153
+ ].join(" "));
154
+ }
155
+ return [toJavaLaunchConfig(java, context)];
156
+ }
157
+ if (binary !== null && java !== null) {
158
+ return [
159
+ toBinaryLaunchConfig(binary.path, binary.source, context),
160
+ toJavaLaunchConfig(java, context),
161
+ ];
162
+ }
163
+ if (binary !== null) {
164
+ return [toBinaryLaunchConfig(binary.path, binary.source, context)];
165
+ }
166
+ if (java !== null) {
167
+ return [toJavaLaunchConfig(java, context)];
168
+ }
169
+ throw new Error([
170
+ "No launcher runtime configured.",
171
+ "Provide one of:",
172
+ "1) options.binaryPath or JONGODB_BINARY_PATH",
173
+ "2) options.classpath or JONGODB_CLASSPATH",
174
+ bundledBinaryHint(),
175
+ ].join(" "));
176
+ }
177
+ function toBinaryLaunchConfig(binaryPath, source, context) {
178
+ return {
179
+ mode: "binary",
180
+ command: binaryPath,
181
+ args: [
182
+ `--host=${context.host}`,
183
+ `--port=${context.port}`,
184
+ `--database=${context.databaseName}`,
185
+ ],
186
+ source,
187
+ };
188
+ }
189
+ function toJavaLaunchConfig(java, context) {
190
+ return {
191
+ mode: "java",
192
+ command: java.javaPath,
193
+ args: [
194
+ "-cp",
195
+ java.classpath,
196
+ java.launcherClass,
197
+ `--host=${context.host}`,
198
+ `--port=${context.port}`,
199
+ `--database=${context.databaseName}`,
200
+ ],
201
+ source: java.source,
202
+ };
203
+ }
204
+ function resolveBinaryCandidate(explicitBinaryPath) {
205
+ const fromOption = normalizeBinaryPath(explicitBinaryPath, "options.binaryPath");
206
+ if (fromOption !== null) {
207
+ return { path: fromOption, source: "options.binaryPath" };
208
+ }
209
+ const fromEnv = normalizeBinaryPath(process.env.JONGODB_BINARY_PATH, "JONGODB_BINARY_PATH");
210
+ if (fromEnv !== null) {
211
+ return { path: fromEnv, source: "JONGODB_BINARY_PATH" };
212
+ }
213
+ const fromBundled = resolveBundledBinaryPath();
214
+ if (fromBundled !== null) {
215
+ return fromBundled;
216
+ }
217
+ return null;
218
+ }
219
+ function normalizeBinaryPath(value, fieldName) {
220
+ if (value === undefined) {
221
+ return null;
222
+ }
223
+ const normalized = value.trim();
224
+ if (normalized.length === 0) {
225
+ throw new Error(`${fieldName} must not be empty when provided.`);
226
+ }
227
+ return normalized;
228
+ }
229
+ function resolveBundledBinaryPath() {
230
+ const candidates = bundledBinaryPackageCandidates();
231
+ for (const packageName of candidates) {
232
+ const pathFromPackage = resolveBinaryPathFromPackage(packageName);
233
+ if (pathFromPackage !== null) {
234
+ return {
235
+ path: pathFromPackage,
236
+ source: `bundled-package:${packageName}`,
237
+ };
238
+ }
239
+ }
240
+ return null;
241
+ }
242
+ function bundledBinaryPackageCandidates() {
243
+ const platform = process.platform;
244
+ const arch = process.arch;
245
+ if (platform === "darwin") {
246
+ return [`${BUNDLED_BINARY_PACKAGE_PREFIX}-darwin-${arch}`];
247
+ }
248
+ if (platform === "win32") {
249
+ return [`${BUNDLED_BINARY_PACKAGE_PREFIX}-win32-${arch}`];
250
+ }
251
+ if (platform === "linux") {
252
+ const libcVariant = detectLinuxLibcVariant();
253
+ return [
254
+ `${BUNDLED_BINARY_PACKAGE_PREFIX}-linux-${arch}-${libcVariant}`,
255
+ `${BUNDLED_BINARY_PACKAGE_PREFIX}-linux-${arch}`,
256
+ ];
257
+ }
258
+ return [];
259
+ }
260
+ function detectLinuxLibcVariant() {
261
+ const report = process.report?.getReport?.();
262
+ const glibcVersionRuntime = report?.header?.glibcVersionRuntime;
263
+ if (typeof glibcVersionRuntime === "string" && glibcVersionRuntime.length > 0) {
264
+ return "gnu";
265
+ }
266
+ return "musl";
267
+ }
268
+ function resolveBinaryPathFromPackage(packageName) {
269
+ try {
270
+ const packageJsonPath = moduleRequire.resolve(`${packageName}/package.json`);
271
+ const packageDir = (0, node_path_1.dirname)(packageJsonPath);
272
+ const packageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, "utf8"));
273
+ const binaryRelativePath = readJongodbBinaryPath(packageJson) ??
274
+ readBinEntryPath(packageJson.bin);
275
+ if (binaryRelativePath === null) {
276
+ return null;
277
+ }
278
+ return (0, node_path_1.resolve)(packageDir, binaryRelativePath);
279
+ }
280
+ catch {
281
+ return null;
282
+ }
283
+ }
284
+ function readJongodbBinaryPath(packageJson) {
285
+ const binary = packageJson.jongodb?.binary;
286
+ if (typeof binary !== "string") {
287
+ return null;
288
+ }
289
+ const normalized = binary.trim();
290
+ return normalized.length === 0 ? null : normalized;
291
+ }
292
+ function readBinEntryPath(value) {
293
+ if (typeof value === "string") {
294
+ const normalized = value.trim();
295
+ return normalized.length === 0 ? null : normalized;
296
+ }
297
+ if (value !== undefined && typeof value === "object") {
298
+ const preferred = value["jongodb-memory-server"];
299
+ if (typeof preferred === "string" && preferred.trim().length > 0) {
300
+ return preferred.trim();
301
+ }
302
+ for (const candidate of Object.values(value)) {
303
+ if (typeof candidate === "string" && candidate.trim().length > 0) {
304
+ return candidate.trim();
305
+ }
306
+ }
307
+ }
308
+ return null;
309
+ }
310
+ function bundledBinaryHint() {
311
+ const candidates = bundledBinaryPackageCandidates();
312
+ if (candidates.length === 0) {
313
+ return "Bundled platform binary package is not defined for this OS/architecture.";
314
+ }
315
+ return `Bundled platform binary package candidates: ${candidates.join(", ")}.`;
316
+ }
317
+ function resolveJavaCandidate(options) {
318
+ const classpath = resolveClasspathOrNull(options.classpath);
319
+ if (classpath === null) {
320
+ return null;
321
+ }
322
+ return {
323
+ javaPath: options.javaPath?.trim() || process.env.JONGODB_JAVA_PATH || "java",
324
+ classpath,
325
+ launcherClass: options.launcherClass?.trim() || DEFAULT_LAUNCHER_CLASS,
326
+ source: options.classpath !== undefined ? "options.classpath" : "JONGODB_CLASSPATH",
327
+ };
328
+ }
329
+ function normalizeTimeout(value, fallback, fieldName) {
330
+ const resolved = value ?? fallback;
331
+ if (!Number.isFinite(resolved) || resolved <= 0) {
332
+ throw new Error(`${fieldName} must be a positive number.`);
333
+ }
334
+ return Math.floor(resolved);
335
+ }
336
+ function normalizeHost(host) {
337
+ const normalized = host?.trim() || DEFAULT_HOST;
338
+ if (normalized.length === 0) {
339
+ throw new Error("host must not be empty.");
340
+ }
341
+ return normalized;
342
+ }
343
+ function normalizePort(port) {
344
+ const normalized = port ?? 0;
345
+ if (!Number.isInteger(normalized) || normalized < 0 || normalized > 65535) {
346
+ throw new Error("port must be an integer between 0 and 65535.");
347
+ }
348
+ return normalized;
349
+ }
350
+ function normalizeDatabaseName(databaseName) {
351
+ const normalized = databaseName?.trim() || DEFAULT_DATABASE;
352
+ if (normalized.length === 0) {
353
+ throw new Error("databaseName must not be empty.");
354
+ }
355
+ return normalized;
356
+ }
357
+ function resolveClasspathOrNull(classpath) {
358
+ const explicit = resolveExplicitClasspath(classpath);
359
+ if (explicit !== null) {
360
+ return explicit;
361
+ }
362
+ const fromEnv = process.env.JONGODB_CLASSPATH?.trim();
363
+ if (fromEnv !== undefined && fromEnv.length > 0) {
364
+ return fromEnv;
365
+ }
366
+ return null;
367
+ }
368
+ function resolveExplicitClasspath(classpath) {
369
+ if (typeof classpath === "string") {
370
+ const normalized = classpath.trim();
371
+ if (normalized.length === 0) {
372
+ throw new Error("classpath string is empty.");
373
+ }
374
+ return normalized;
375
+ }
376
+ if (Array.isArray(classpath)) {
377
+ if (classpath.length === 0) {
378
+ throw new Error("classpath array is empty.");
379
+ }
380
+ const normalizedParts = classpath
381
+ .map((part) => part.trim())
382
+ .filter((part) => part.length > 0);
383
+ if (normalizedParts.length === 0) {
384
+ throw new Error("classpath array has no valid entries.");
385
+ }
386
+ return normalizedParts.join(node_path_1.delimiter);
387
+ }
388
+ return null;
389
+ }
390
+ async function waitForStartup(params) {
391
+ const { child, stdoutReader, stderrReader, stdoutLines, stderrLines, startupTimeoutMs, logLevel, launchDescription, } = params;
392
+ return new Promise((resolve, reject) => {
393
+ let settled = false;
394
+ let resolvedUri = null;
395
+ const timeout = setTimeout(() => {
396
+ if (settled) {
397
+ return;
398
+ }
399
+ settled = true;
400
+ reject(new Error([
401
+ `Timed out waiting for jongodb startup after ${startupTimeoutMs}ms (${launchDescription}).`,
402
+ formatLogTail("stdout", stdoutLines),
403
+ formatLogTail("stderr", stderrLines),
404
+ ].join(" ")));
405
+ }, startupTimeoutMs);
406
+ const cleanupListeners = () => {
407
+ stdoutReader.off("line", onStdout);
408
+ stderrReader.off("line", onStderr);
409
+ child.off("error", onError);
410
+ child.off("exit", onExit);
411
+ };
412
+ const finish = (fn) => {
413
+ if (settled) {
414
+ return;
415
+ }
416
+ settled = true;
417
+ clearTimeout(timeout);
418
+ cleanupListeners();
419
+ fn();
420
+ };
421
+ const onStdout = (line) => {
422
+ appendLine(stdoutLines, line);
423
+ maybeLog("stdout", line, logLevel);
424
+ if (!line.startsWith(READY_PREFIX)) {
425
+ return;
426
+ }
427
+ const uri = line.slice(READY_PREFIX.length).trim();
428
+ if (uri.length === 0) {
429
+ finish(() => reject(new Error("Launcher emitted empty JONGODB_URI line.")));
430
+ return;
431
+ }
432
+ resolvedUri = uri;
433
+ finish(() => resolve({ uri }));
434
+ };
435
+ const onStderr = (line) => {
436
+ appendLine(stderrLines, line);
437
+ maybeLog("stderr", line, logLevel);
438
+ };
439
+ const onError = (error) => {
440
+ finish(() => {
441
+ reject(new Error([
442
+ `Failed to spawn launcher '${child.spawnfile}': ${error.message}`,
443
+ `Launch source: ${launchDescription}.`,
444
+ "Check binary/classpath configuration.",
445
+ ].join(" ")));
446
+ });
447
+ };
448
+ const onExit = (code, signal) => {
449
+ if (resolvedUri !== null) {
450
+ return;
451
+ }
452
+ finish(() => {
453
+ reject(new Error([
454
+ `Jongodb process exited before readiness (code=${code}, signal=${signal}).`,
455
+ `Launch source: ${launchDescription}.`,
456
+ formatFailureLine(stderrLines),
457
+ formatLogTail("stdout", stdoutLines),
458
+ formatLogTail("stderr", stderrLines),
459
+ ].join(" ")));
460
+ });
461
+ };
462
+ stdoutReader.on("line", onStdout);
463
+ stderrReader.on("line", onStderr);
464
+ child.once("error", onError);
465
+ child.once("exit", onExit);
466
+ });
467
+ }
468
+ function maybeLog(stream, line, logLevel) {
469
+ if (logLevel === "silent") {
470
+ return;
471
+ }
472
+ if (logLevel === "info" && stream === "stdout") {
473
+ return;
474
+ }
475
+ if (stream === "stdout") {
476
+ // eslint-disable-next-line no-console
477
+ console.log(`[jongodb:${stream}] ${line}`);
478
+ return;
479
+ }
480
+ // eslint-disable-next-line no-console
481
+ console.error(`[jongodb:${stream}] ${line}`);
482
+ }
483
+ function appendLine(lines, line) {
484
+ lines.push(line);
485
+ if (lines.length > MAX_LOG_LINES) {
486
+ lines.shift();
487
+ }
488
+ }
489
+ function formatLogTail(name, lines) {
490
+ if (lines.length === 0) {
491
+ return `${name}:<empty>`;
492
+ }
493
+ return `${name}:` + lines.join(" | ");
494
+ }
495
+ function formatFailureLine(stderrLines) {
496
+ const failureLine = stderrLines.find((line) => line.startsWith(FAILURE_PREFIX));
497
+ if (failureLine === undefined) {
498
+ return "";
499
+ }
500
+ return failureLine;
501
+ }
502
+ async function forceStopIfAlive(child, stopTimeoutMs) {
503
+ if (child.exitCode !== null) {
504
+ return;
505
+ }
506
+ child.kill("SIGTERM");
507
+ const graceful = await waitForExit(child, stopTimeoutMs);
508
+ if (graceful !== null) {
509
+ return;
510
+ }
511
+ child.kill("SIGKILL");
512
+ await waitForExit(child, stopTimeoutMs);
513
+ }
514
+ function waitForExit(child, timeoutMs) {
515
+ if (child.exitCode !== null) {
516
+ return Promise.resolve({
517
+ code: child.exitCode,
518
+ signal: child.signalCode,
519
+ });
520
+ }
521
+ return new Promise((resolve) => {
522
+ const timeout = setTimeout(() => {
523
+ cleanup();
524
+ resolve(null);
525
+ }, timeoutMs);
526
+ const onExit = (code, signal) => {
527
+ cleanup();
528
+ resolve({ code, signal });
529
+ };
530
+ const cleanup = () => {
531
+ clearTimeout(timeout);
532
+ child.off("exit", onExit);
533
+ };
534
+ child.on("exit", onExit);
535
+ });
536
+ }
537
+ function wrapError(error) {
538
+ if (error instanceof Error) {
539
+ return error;
540
+ }
541
+ return new Error(String(error));
542
+ }
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.registerJongodbForJest = registerJongodbForJest;
7
+ exports.createJestGlobalSetup = createJestGlobalSetup;
8
+ exports.createJestGlobalTeardown = createJestGlobalTeardown;
9
+ exports.readJestGlobalState = readJestGlobalState;
10
+ exports.readJestGlobalUri = readJestGlobalUri;
11
+ const promises_1 = require("node:fs/promises");
12
+ const node_path_1 = __importDefault(require("node:path"));
13
+ const index_js_1 = require("./index.js");
14
+ const runtime_js_1 = require("./runtime.js");
15
+ const DEFAULT_ENV_VAR_NAME = "MONGODB_URI";
16
+ const DEFAULT_STATE_FILE = node_path_1.default.join(process.cwd(), ".jongodb", "jest-memory-server.json");
17
+ const DEFAULT_STOP_TIMEOUT_MS = 5_000;
18
+ function registerJongodbForJest(hooks, options = {}) {
19
+ const runtime = (0, runtime_js_1.createJongodbEnvRuntime)(options);
20
+ hooks.beforeAll(async () => {
21
+ await runtime.setup();
22
+ });
23
+ hooks.afterAll(async () => {
24
+ await runtime.teardown();
25
+ });
26
+ return {
27
+ get uri() {
28
+ return runtime.uri;
29
+ },
30
+ };
31
+ }
32
+ function createJestGlobalSetup(options = {}) {
33
+ return async () => {
34
+ const { envVarName, stateFile, runtimeOptions } = splitLifecycleOptions(options);
35
+ const server = await (0, index_js_1.startJongodbMemoryServer)(runtimeOptions);
36
+ process.env[envVarName] = server.uri;
37
+ await (0, promises_1.mkdir)(node_path_1.default.dirname(stateFile), { recursive: true });
38
+ const state = {
39
+ uri: server.uri,
40
+ pid: server.pid,
41
+ envVarName,
42
+ };
43
+ await (0, promises_1.writeFile)(stateFile, JSON.stringify(state, null, 2), "utf8");
44
+ server.detach();
45
+ };
46
+ }
47
+ function createJestGlobalTeardown(options = {}) {
48
+ return async () => {
49
+ const { stateFile } = splitLifecycleOptions(options);
50
+ const state = await readJestGlobalState({ stateFile });
51
+ if (state === null) {
52
+ await (0, promises_1.rm)(stateFile, { force: true });
53
+ return;
54
+ }
55
+ try {
56
+ await terminatePid(state.pid, options.killTimeoutMs ?? DEFAULT_STOP_TIMEOUT_MS);
57
+ }
58
+ finally {
59
+ await (0, promises_1.rm)(stateFile, { force: true });
60
+ }
61
+ };
62
+ }
63
+ async function readJestGlobalState(options = {}) {
64
+ const stateFile = normalizeStateFile(options.stateFile);
65
+ try {
66
+ const raw = await (0, promises_1.readFile)(stateFile, "utf8");
67
+ const parsed = JSON.parse(raw);
68
+ if (typeof parsed.uri !== "string" ||
69
+ typeof parsed.pid !== "number" ||
70
+ typeof parsed.envVarName !== "string") {
71
+ throw new Error("Jest global state file has invalid schema.");
72
+ }
73
+ return parsed;
74
+ }
75
+ catch (error) {
76
+ if (isMissingFileError(error)) {
77
+ return null;
78
+ }
79
+ throw error;
80
+ }
81
+ }
82
+ async function readJestGlobalUri(options = {}) {
83
+ const state = await readJestGlobalState(options);
84
+ if (state === null) {
85
+ return null;
86
+ }
87
+ return state.uri;
88
+ }
89
+ function splitLifecycleOptions(options) {
90
+ const { envVarName, stateFile, killTimeoutMs: _killTimeoutMs, ...runtimeOptions } = options;
91
+ return {
92
+ envVarName: normalizeEnvVarName(envVarName),
93
+ stateFile: normalizeStateFile(stateFile),
94
+ runtimeOptions,
95
+ };
96
+ }
97
+ function normalizeEnvVarName(name) {
98
+ const normalized = name?.trim() || DEFAULT_ENV_VAR_NAME;
99
+ if (normalized.length === 0) {
100
+ throw new Error("envVarName must not be empty.");
101
+ }
102
+ return normalized;
103
+ }
104
+ function normalizeStateFile(stateFile) {
105
+ const normalized = stateFile?.trim() || DEFAULT_STATE_FILE;
106
+ if (normalized.length === 0) {
107
+ throw new Error("stateFile must not be empty.");
108
+ }
109
+ return normalized;
110
+ }
111
+ async function terminatePid(pid, timeoutMs) {
112
+ if (!Number.isInteger(pid) || pid <= 0) {
113
+ throw new Error(`Invalid PID in Jest global state: ${pid}`);
114
+ }
115
+ if (!isProcessRunning(pid)) {
116
+ return;
117
+ }
118
+ process.kill(pid, "SIGTERM");
119
+ const deadline = Date.now() + timeoutMs;
120
+ while (Date.now() < deadline) {
121
+ if (!isProcessRunning(pid)) {
122
+ return;
123
+ }
124
+ await sleep(50);
125
+ }
126
+ if (!isProcessRunning(pid)) {
127
+ return;
128
+ }
129
+ process.kill(pid, "SIGKILL");
130
+ await waitForProcessExit(pid, timeoutMs);
131
+ if (isProcessRunning(pid)) {
132
+ throw new Error(`Unable to stop detached Jest process pid=${pid} after SIGKILL.`);
133
+ }
134
+ }
135
+ function isProcessRunning(pid) {
136
+ try {
137
+ process.kill(pid, 0);
138
+ return true;
139
+ }
140
+ catch (error) {
141
+ if (isNoSuchProcessError(error)) {
142
+ return false;
143
+ }
144
+ throw error;
145
+ }
146
+ }
147
+ function isNoSuchProcessError(error) {
148
+ return (typeof error === "object" &&
149
+ error !== null &&
150
+ "code" in error &&
151
+ error.code === "ESRCH");
152
+ }
153
+ function isMissingFileError(error) {
154
+ return (typeof error === "object" &&
155
+ error !== null &&
156
+ "code" in error &&
157
+ error.code === "ENOENT");
158
+ }
159
+ function sleep(ms) {
160
+ return new Promise((resolve) => {
161
+ setTimeout(resolve, ms);
162
+ });
163
+ }
164
+ async function waitForProcessExit(pid, timeoutMs) {
165
+ const deadline = Date.now() + timeoutMs;
166
+ while (Date.now() < deadline) {
167
+ if (!isProcessRunning(pid)) {
168
+ return;
169
+ }
170
+ await sleep(50);
171
+ }
172
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerJongodbForNestJest = registerJongodbForNestJest;
4
+ const jest_js_1 = require("./jest.js");
5
+ /**
6
+ * Convenience wrapper for NestJS E2E tests that run on Jest.
7
+ */
8
+ function registerJongodbForNestJest(hooks, options = {}) {
9
+ return (0, jest_js_1.registerJongodbForJest)(hooks, options);
10
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createJongodbEnvRuntime = createJongodbEnvRuntime;
4
+ const index_js_1 = require("./index.js");
5
+ const DEFAULT_ENV_VAR_NAME = "MONGODB_URI";
6
+ function createJongodbEnvRuntime(options = {}) {
7
+ const envVarName = normalizeEnvVarName(options.envVarName);
8
+ const { envVarName: _envVarName, ...serverOptions } = options;
9
+ let runtimeServer = null;
10
+ let uri = null;
11
+ let previousEnvValue;
12
+ let hadPreviousEnv = false;
13
+ return {
14
+ envVarName,
15
+ get running() {
16
+ return runtimeServer !== null;
17
+ },
18
+ get uri() {
19
+ if (uri === null) {
20
+ throw new Error("Jongodb URI is not available before setup completes.");
21
+ }
22
+ return uri;
23
+ },
24
+ async setup() {
25
+ if (runtimeServer !== null && uri !== null) {
26
+ return uri;
27
+ }
28
+ hadPreviousEnv = Object.prototype.hasOwnProperty.call(process.env, envVarName);
29
+ previousEnvValue = process.env[envVarName];
30
+ runtimeServer = await (0, index_js_1.startJongodbMemoryServer)(serverOptions);
31
+ uri = runtimeServer.uri;
32
+ process.env[envVarName] = uri;
33
+ return uri;
34
+ },
35
+ async teardown() {
36
+ if (runtimeServer !== null) {
37
+ await runtimeServer.stop();
38
+ runtimeServer = null;
39
+ }
40
+ if (hadPreviousEnv) {
41
+ process.env[envVarName] = previousEnvValue;
42
+ }
43
+ else {
44
+ delete process.env[envVarName];
45
+ }
46
+ uri = null;
47
+ previousEnvValue = undefined;
48
+ hadPreviousEnv = false;
49
+ },
50
+ };
51
+ }
52
+ function normalizeEnvVarName(name) {
53
+ const normalized = name?.trim() || DEFAULT_ENV_VAR_NAME;
54
+ if (normalized.length === 0) {
55
+ throw new Error("envVarName must not be empty.");
56
+ }
57
+ return normalized;
58
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerJongodbForVitest = registerJongodbForVitest;
4
+ const runtime_js_1 = require("./runtime.js");
5
+ function registerJongodbForVitest(hooks, options = {}) {
6
+ const runtime = (0, runtime_js_1.createJongodbEnvRuntime)(options);
7
+ hooks.beforeAll(async () => {
8
+ await runtime.setup();
9
+ });
10
+ hooks.afterAll(async () => {
11
+ await runtime.teardown();
12
+ });
13
+ return {
14
+ get uri() {
15
+ return runtime.uri;
16
+ },
17
+ };
18
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAqBA,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5C,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAcD,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,mBAAmB,CAAC,CA6C9B"}
@@ -3,7 +3,7 @@ import { readFileSync } from "node:fs";
3
3
  import { createRequire } from "node:module";
4
4
  import { delimiter, dirname, resolve } from "node:path";
5
5
  import { createInterface } from "node:readline";
6
- const require = createRequire(import.meta.url);
6
+ const moduleRequire = createRequire(resolve(process.cwd(), "__jongodb_module_resolver__.js"));
7
7
  const READY_PREFIX = "JONGODB_URI=";
8
8
  const FAILURE_PREFIX = "JONGODB_START_FAILURE=";
9
9
  const DEFAULT_HOST = "127.0.0.1";
@@ -264,7 +264,7 @@ function detectLinuxLibcVariant() {
264
264
  }
265
265
  function resolveBinaryPathFromPackage(packageName) {
266
266
  try {
267
- const packageJsonPath = require.resolve(`${packageName}/package.json`);
267
+ const packageJsonPath = moduleRequire.resolve(`${packageName}/package.json`);
268
268
  const packageDir = dirname(packageJsonPath);
269
269
  const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
270
270
  const binaryRelativePath = readJongodbBinaryPath(packageJson) ??
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest.d.ts","sourceRoot":"","sources":["../../src/jest.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,eAAgB,SAAQ,0BAA0B;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA2B,SAAQ,0BAA0B;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,OAAO,GAAE,eAAoB,GAC5B,2BAA2B,CAgB7B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,0BAA+B,GACvC,MAAM,OAAO,CAAC,IAAI,CAAC,CAiBrB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,0BAA+B,GACvC,MAAM,OAAO,CAAC,IAAI,CAAC,CAkBrB;AAED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAmBvC;AAED,wBAAsB,iBAAiB,CAAC,OAAO,GAAE;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM9B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs.d.ts","sourceRoot":"","sources":["../../src/nestjs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAEjC,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AACtD,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;AACjD,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEtE;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,2BAA2B,CAE7B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA0B,EAEhC,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,wBAAyB,SAAQ,0BAA0B;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B,GACrC,iBAAiB,CAkDnB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../../src/vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,mBAAmB,EAC1B,OAAO,GAAE,iBAAsB,GAC9B,6BAA6B,CAgB/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jongodb/memory-server",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Node.js test runtime adapter for jongodb standalone launcher (MongoDB-compatible integration tests).",
5
5
  "keywords": [
6
6
  "mongodb",
@@ -25,44 +25,55 @@
25
25
  "license": "Apache-2.0",
26
26
  "author": "jongodb contributors",
27
27
  "type": "module",
28
- "main": "./dist/index.js",
29
- "types": "./dist/index.d.ts",
28
+ "main": "./dist/cjs/index.js",
29
+ "module": "./dist/esm/index.js",
30
+ "types": "./dist/esm/index.d.ts",
30
31
  "exports": {
31
32
  ".": {
32
- "types": "./dist/index.d.ts",
33
- "default": "./dist/index.js"
33
+ "types": "./dist/esm/index.d.ts",
34
+ "import": "./dist/esm/index.js",
35
+ "require": "./dist/cjs/index.js",
36
+ "default": "./dist/esm/index.js"
34
37
  },
35
38
  "./jest": {
36
- "types": "./dist/jest.d.ts",
37
- "default": "./dist/jest.js"
39
+ "types": "./dist/esm/jest.d.ts",
40
+ "import": "./dist/esm/jest.js",
41
+ "require": "./dist/cjs/jest.js",
42
+ "default": "./dist/esm/jest.js"
38
43
  },
39
44
  "./runtime": {
40
- "types": "./dist/runtime.d.ts",
41
- "default": "./dist/runtime.js"
45
+ "types": "./dist/esm/runtime.d.ts",
46
+ "import": "./dist/esm/runtime.js",
47
+ "require": "./dist/cjs/runtime.js",
48
+ "default": "./dist/esm/runtime.js"
42
49
  },
43
50
  "./nestjs": {
44
- "types": "./dist/nestjs.d.ts",
45
- "default": "./dist/nestjs.js"
51
+ "types": "./dist/esm/nestjs.d.ts",
52
+ "import": "./dist/esm/nestjs.js",
53
+ "require": "./dist/cjs/nestjs.js",
54
+ "default": "./dist/esm/nestjs.js"
46
55
  },
47
56
  "./vitest": {
48
- "types": "./dist/vitest.d.ts",
49
- "default": "./dist/vitest.js"
57
+ "types": "./dist/esm/vitest.d.ts",
58
+ "import": "./dist/esm/vitest.js",
59
+ "require": "./dist/cjs/vitest.js",
60
+ "default": "./dist/esm/vitest.js"
50
61
  },
51
62
  "./package.json": "./package.json"
52
63
  },
53
64
  "typesVersions": {
54
65
  "*": {
55
66
  "jest": [
56
- "./dist/jest.d.ts"
67
+ "./dist/esm/jest.d.ts"
57
68
  ],
58
69
  "runtime": [
59
- "./dist/runtime.d.ts"
70
+ "./dist/esm/runtime.d.ts"
60
71
  ],
61
72
  "nestjs": [
62
- "./dist/nestjs.d.ts"
73
+ "./dist/esm/nestjs.d.ts"
63
74
  ],
64
75
  "vitest": [
65
- "./dist/vitest.d.ts"
76
+ "./dist/esm/vitest.d.ts"
66
77
  ]
67
78
  }
68
79
  },
@@ -79,26 +90,32 @@
79
90
  "access": "public"
80
91
  },
81
92
  "optionalDependencies": {
82
- "@jongodb/memory-server-bin-darwin-arm64": "0.1.1",
83
- "@jongodb/memory-server-bin-linux-x64-gnu": "0.1.1",
84
- "@jongodb/memory-server-bin-win32-x64": "0.1.1"
93
+ "@jongodb/memory-server-bin-darwin-arm64": "0.1.2",
94
+ "@jongodb/memory-server-bin-linux-x64-gnu": "0.1.2",
95
+ "@jongodb/memory-server-bin-win32-x64": "0.1.2"
85
96
  },
86
97
  "files": [
87
98
  "dist",
88
99
  "README.md",
89
100
  "LICENSE",
90
- "!dist/test",
91
- "!dist/test/**"
101
+ "!dist/**/test",
102
+ "!dist/**/test/**",
103
+ "!dist/**/*.test.js",
104
+ "!dist/**/*.test.d.ts",
105
+ "!dist/**/*.test.d.ts.map"
92
106
  ],
93
107
  "engines": {
94
108
  "node": ">=20"
95
109
  },
96
110
  "scripts": {
97
111
  "clean": "rm -rf dist",
98
- "build": "tsc -p tsconfig.json",
112
+ "build": "npm run build:esm && npm run build:cjs && npm run build:post",
113
+ "build:esm": "tsc -p tsconfig.build.esm.json",
114
+ "build:cjs": "tsc -p tsconfig.build.cjs.json",
115
+ "build:post": "node ./scripts/write-cjs-package.mjs",
99
116
  "typecheck": "tsc -p tsconfig.json --noEmit",
100
117
  "pretest": "npm run build",
101
- "test": "node --test dist/test/*.test.js",
118
+ "test": "node --test dist/esm/test/*.test.js && node ./scripts/cjs-smoke.cjs",
102
119
  "prepack": "npm run clean && npm run build",
103
120
  "release:check": "npm run build && npm run typecheck && npm run test && npm pack --dry-run"
104
121
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5C,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAcD,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,mBAAmB,CAAC,CA6C9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jest.d.ts","sourceRoot":"","sources":["../src/jest.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,eAAgB,SAAQ,0BAA0B;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA2B,SAAQ,0BAA0B;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,OAAO,GAAE,eAAoB,GAC5B,2BAA2B,CAgB7B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,0BAA+B,GACvC,MAAM,OAAO,CAAC,IAAI,CAAC,CAiBrB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,0BAA+B,GACvC,MAAM,OAAO,CAAC,IAAI,CAAC,CAkBrB;AAED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAmBvC;AAED,wBAAsB,iBAAiB,CAAC,OAAO,GAAE;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nestjs.d.ts","sourceRoot":"","sources":["../src/nestjs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAEjC,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AACtD,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;AACjD,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEtE;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,2BAA2B,CAE7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA0B,EAEhC,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,wBAAyB,SAAQ,0BAA0B;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B,GACrC,iBAAiB,CAkDnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,mBAAmB,EAC1B,OAAO,GAAE,iBAAsB,GAC9B,6BAA6B,CAgB/B"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes