testcontainers 12.2.0 → 12.2.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.
Files changed (123) hide show
  1. package/build/common/file-lock.js +3 -3
  2. package/build/common/hash.js +2 -2
  3. package/build/common/index.d.ts +2 -3
  4. package/build/common/index.js +2 -4
  5. package/build/common/retry.d.ts +1 -1
  6. package/build/common/uuid.js +2 -2
  7. package/build/container-runtime/auth/auths.d.ts +2 -2
  8. package/build/container-runtime/auth/cred-helpers.d.ts +1 -1
  9. package/build/container-runtime/auth/credential-provider.d.ts +2 -2
  10. package/build/container-runtime/auth/credential-provider.js +3 -3
  11. package/build/container-runtime/auth/creds-store.d.ts +2 -2
  12. package/build/container-runtime/auth/creds-store.js +1 -1
  13. package/build/container-runtime/auth/get-auth-config.d.ts +1 -1
  14. package/build/container-runtime/auth/get-auth-config.js +7 -7
  15. package/build/container-runtime/auth/registry-auth-locator.d.ts +1 -1
  16. package/build/container-runtime/auth/registry-matches.js +1 -1
  17. package/build/container-runtime/clients/client.d.ts +5 -5
  18. package/build/container-runtime/clients/compose/compose-client.d.ts +1 -1
  19. package/build/container-runtime/clients/compose/compose-client.js +1 -3
  20. package/build/container-runtime/clients/compose/default-compose-options.d.ts +2 -2
  21. package/build/container-runtime/clients/compose/default-compose-options.js +5 -3
  22. package/build/container-runtime/clients/compose/types.d.ts +3 -2
  23. package/build/container-runtime/clients/container/container-client.d.ts +5 -4
  24. package/build/container-runtime/clients/container/docker-container-client.d.ts +6 -5
  25. package/build/container-runtime/clients/container/docker-container-client.js +8 -9
  26. package/build/container-runtime/clients/container/types.d.ts +1 -3
  27. package/build/container-runtime/clients/image/docker-image-client.d.ts +4 -3
  28. package/build/container-runtime/clients/image/docker-image-client.js +11 -10
  29. package/build/container-runtime/clients/image/image-client.d.ts +2 -2
  30. package/build/container-runtime/clients/network/docker-network-client.d.ts +3 -2
  31. package/build/container-runtime/clients/network/network-client.d.ts +1 -1
  32. package/build/container-runtime/image-name.js +2 -2
  33. package/build/container-runtime/index.d.ts +1 -1
  34. package/build/container-runtime/strategies/configuration-strategy.d.ts +2 -2
  35. package/build/container-runtime/strategies/configuration-strategy.js +7 -7
  36. package/build/container-runtime/strategies/npipe-socket-strategy.d.ts +2 -2
  37. package/build/container-runtime/strategies/rootless-unix-socket-strategy.d.ts +2 -2
  38. package/build/container-runtime/strategies/rootless-unix-socket-strategy.js +9 -9
  39. package/build/container-runtime/strategies/strategy.d.ts +1 -1
  40. package/build/container-runtime/strategies/testcontainers-host-strategy.d.ts +2 -2
  41. package/build/container-runtime/strategies/testcontainers-host-strategy.js +2 -2
  42. package/build/container-runtime/strategies/types.d.ts +1 -1
  43. package/build/container-runtime/strategies/unix-socket-strategy.d.ts +2 -2
  44. package/build/container-runtime/strategies/unix-socket-strategy.js +2 -2
  45. package/build/container-runtime/strategies/utils/config.js +12 -12
  46. package/build/container-runtime/utils/attach-container.d.ts +2 -2
  47. package/build/container-runtime/utils/demux-stream.d.ts +2 -2
  48. package/build/container-runtime/utils/demux-stream.js +2 -2
  49. package/build/container-runtime/utils/image-exists.d.ts +2 -2
  50. package/build/container-runtime/utils/lookup-host-ips.d.ts +1 -1
  51. package/build/container-runtime/utils/lookup-host-ips.js +4 -4
  52. package/build/container-runtime/utils/pull-image.d.ts +2 -2
  53. package/build/container-runtime/utils/remote-container-runtime-socket-path.d.ts +1 -1
  54. package/build/container-runtime/utils/remote-container-runtime-socket-path.js +2 -2
  55. package/build/container-runtime/utils/resolve-host.d.ts +2 -2
  56. package/build/container-runtime/utils/resolve-host.js +4 -4
  57. package/build/container-runtime/utils/run-in-container.d.ts +1 -1
  58. package/build/container-runtime/utils/run-in-container.js +2 -1
  59. package/build/container-runtime/utils/start-container.d.ts +1 -1
  60. package/build/docker-compose-environment/docker-compose-environment.d.ts +5 -5
  61. package/build/docker-compose-environment/docker-compose-environment.js +13 -7
  62. package/build/docker-compose-environment/started-docker-compose-environment.d.ts +2 -2
  63. package/build/docker-compose-environment/stopped-docker-compose-environment.d.ts +1 -1
  64. package/build/generic-container/abstract-started-container.d.ts +3 -3
  65. package/build/generic-container/abstract-stopped-container.d.ts +1 -1
  66. package/build/generic-container/generic-container-builder.d.ts +3 -3
  67. package/build/generic-container/generic-container-builder.js +5 -5
  68. package/build/generic-container/generic-container.d.ts +9 -9
  69. package/build/generic-container/generic-container.js +10 -4
  70. package/build/generic-container/inspect-container-util-ports-exposed.d.ts +1 -1
  71. package/build/generic-container/inspect-container-util-ports-exposed.js +1 -1
  72. package/build/generic-container/started-generic-container.d.ts +6 -5
  73. package/build/generic-container/started-generic-container.js +19 -16
  74. package/build/generic-container/stopped-generic-container.d.ts +2 -2
  75. package/build/index.d.ts +4 -4
  76. package/build/index.js +3 -3
  77. package/build/network/network.d.ts +3 -3
  78. package/build/port-forwarder/port-forwarder.d.ts +2 -3
  79. package/build/port-forwarder/port-forwarder.js +25 -19
  80. package/build/reaper/reaper.d.ts +1 -1
  81. package/build/reaper/reaper.js +21 -19
  82. package/build/socat/socat-container.d.ts +0 -2
  83. package/build/socat/socat-container.js +0 -3
  84. package/build/test-container.d.ts +6 -6
  85. package/build/test-containers.js +2 -1
  86. package/build/types.d.ts +3 -4
  87. package/build/utils/bound-ports.d.ts +3 -3
  88. package/build/utils/bound-ports.js +2 -2
  89. package/build/utils/dockerfile-parser.d.ts +1 -1
  90. package/build/utils/dockerfile-parser.js +2 -2
  91. package/build/utils/labels.d.ts +0 -2
  92. package/build/utils/labels.js +5 -5
  93. package/build/utils/map-inspect-result.d.ts +2 -2
  94. package/build/utils/map-inspect-result.js +12 -13
  95. package/build/utils/pull-policy.js +1 -0
  96. package/build/version.d.ts +1 -1
  97. package/build/version.js +1 -1
  98. package/build/wait-strategies/composite-wait-strategy.d.ts +3 -3
  99. package/build/wait-strategies/composite-wait-strategy.js +3 -1
  100. package/build/wait-strategies/health-check-wait-strategy.d.ts +1 -1
  101. package/build/wait-strategies/host-port-wait-strategy.d.ts +2 -2
  102. package/build/wait-strategies/http-wait-strategy.d.ts +2 -2
  103. package/build/wait-strategies/http-wait-strategy.js +4 -7
  104. package/build/wait-strategies/log-wait-strategy.d.ts +3 -3
  105. package/build/wait-strategies/log-wait-strategy.js +1 -1
  106. package/build/wait-strategies/one-shot-startup-startegy.d.ts +2 -2
  107. package/build/wait-strategies/shell-wait-strategy.d.ts +1 -1
  108. package/build/wait-strategies/startup-check-strategy.d.ts +1 -2
  109. package/build/wait-strategies/startup-check-strategy.js +0 -3
  110. package/build/wait-strategies/utils/health-check.d.ts +2 -4
  111. package/build/wait-strategies/utils/health-check.js +4 -6
  112. package/build/wait-strategies/utils/port-check.d.ts +2 -2
  113. package/build/wait-strategies/utils/port-check.js +2 -2
  114. package/build/wait-strategies/utils/undici-response-parser.d.ts +1 -1
  115. package/build/wait-strategies/utils/undici-response-parser.js +2 -2
  116. package/build/wait-strategies/utils/wait-strategy-selector.d.ts +4 -4
  117. package/build/wait-strategies/wait-for-container.d.ts +4 -4
  118. package/build/wait-strategies/wait-strategy.d.ts +2 -2
  119. package/build/wait-strategies/wait.d.ts +3 -3
  120. package/build/wait-strategies/wait.js +1 -0
  121. package/package.json +2 -3
  122. package/build/common/streams.d.ts +0 -6
  123. package/build/common/streams.js +0 -12
package/build/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
- exports.LIB_VERSION = "12.2.0";
4
+ exports.LIB_VERSION = "12.2.1";
@@ -1,6 +1,6 @@
1
- import Dockerode from "dockerode";
2
- import { BoundPorts } from "../utils/bound-ports";
3
- import { AbstractWaitStrategy, WaitStrategy } from "./wait-strategy";
1
+ import type Dockerode from "dockerode";
2
+ import type { BoundPorts } from "../utils/bound-ports";
3
+ import { AbstractWaitStrategy, type WaitStrategy } from "./wait-strategy";
4
4
  export declare class CompositeWaitStrategy extends AbstractWaitStrategy {
5
5
  private readonly waitStrategies;
6
6
  private deadline?;
@@ -37,7 +37,9 @@ class CompositeWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
37
37
  withStartupTimeout(startupTimeoutMs) {
38
38
  this.waitStrategies
39
39
  .filter((waitStrategy) => !waitStrategy.isStartupTimeoutSet())
40
- .forEach((waitStrategy) => waitStrategy.withStartupTimeout(startupTimeoutMs));
40
+ .forEach((waitStrategy) => {
41
+ waitStrategy.withStartupTimeout(startupTimeoutMs);
42
+ });
41
43
  return this;
42
44
  }
43
45
  withDeadline(deadline) {
@@ -1,4 +1,4 @@
1
- import Dockerode from "dockerode";
1
+ import type Dockerode from "dockerode";
2
2
  import { AbstractWaitStrategy } from "./wait-strategy";
3
3
  export declare class HealthCheckWaitStrategy extends AbstractWaitStrategy {
4
4
  waitUntilReady(container: Dockerode.Container): Promise<void>;
@@ -1,5 +1,5 @@
1
- import Dockerode from "dockerode";
2
- import { BoundPorts } from "../utils/bound-ports";
1
+ import type Dockerode from "dockerode";
2
+ import type { BoundPorts } from "../utils/bound-ports";
3
3
  import { AbstractWaitStrategy } from "./wait-strategy";
4
4
  export declare class HostPortWaitStrategy extends AbstractWaitStrategy {
5
5
  waitUntilReady(container: Dockerode.Container, boundPorts: BoundPorts): Promise<void>;
@@ -1,5 +1,5 @@
1
- import Dockerode from "dockerode";
2
- import { BoundPorts } from "../utils/bound-ports";
1
+ import type Dockerode from "dockerode";
2
+ import type { BoundPorts } from "../utils/bound-ports";
3
3
  import { AbstractWaitStrategy } from "./wait-strategy";
4
4
  export interface HttpWaitStrategyOptions {
5
5
  abortOnContainerExit?: boolean;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpWaitStrategy = void 0;
4
+ const consumers_1 = require("node:stream/consumers");
4
5
  const undici_1 = require("undici");
5
6
  const common_1 = require("../common");
6
7
  const container_runtime_1 = require("../container-runtime");
@@ -126,17 +127,13 @@ class HttpWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
126
127
  }
127
128
  async handleContainerExit(container) {
128
129
  const tail = 50;
129
- const lastLogs = [];
130
130
  const client = await (0, container_runtime_1.getContainerRuntimeClient)();
131
131
  let message;
132
132
  try {
133
- const stream = await client.container.logs(container, { tail });
134
- await new Promise((res) => {
135
- stream.on("data", (d) => lastLogs.push(d.trim())).on("end", res);
136
- });
137
- message = `Container exited during HTTP healthCheck, last ${tail} logs: ${lastLogs.join("\n")}`;
133
+ const lastLogs = await (0, consumers_1.text)(await client.container.logs(container, { tail }));
134
+ message = `Container exited during HTTP healthCheck, last ${tail} logs: ${lastLogs.trim()}`;
138
135
  }
139
- catch (err) {
136
+ catch (_err) {
140
137
  message = "Container exited during HTTP healthCheck, failed to get last logs";
141
138
  }
142
139
  common_1.log.error(message, { containerId: container.id });
@@ -1,10 +1,10 @@
1
- import Dockerode from "dockerode";
2
- import { BoundPorts } from "../utils/bound-ports";
1
+ import type Dockerode from "dockerode";
2
+ import type { BoundPorts } from "../utils/bound-ports";
3
3
  import { AbstractWaitStrategy } from "./wait-strategy";
4
4
  export type Log = string;
5
5
  export declare class LogWaitStrategy extends AbstractWaitStrategy {
6
6
  private readonly message;
7
7
  private readonly times;
8
8
  constructor(message: Log | RegExp, times: number);
9
- waitUntilReady(container: Dockerode.Container, boundPorts: BoundPorts, startTime?: Date): Promise<void>;
9
+ waitUntilReady(container: Dockerode.Container, _boundPorts: BoundPorts, startTime?: Date): Promise<void>;
10
10
  }
@@ -16,7 +16,7 @@ class LogWaitStrategy extends wait_strategy_1.AbstractWaitStrategy {
16
16
  this.message = message;
17
17
  this.times = times;
18
18
  }
19
- async waitUntilReady(container, boundPorts, startTime) {
19
+ async waitUntilReady(container, _boundPorts, startTime) {
20
20
  common_1.log.debug(`Waiting for log message "${this.message}"...`, { containerId: container.id });
21
21
  const client = await (0, container_runtime_1.getContainerRuntimeClient)();
22
22
  const stream = await client.container.logs(container, { since: startTime ? startTime.getTime() / 1000 : 0 });
@@ -1,5 +1,5 @@
1
- import Dockerode from "dockerode";
2
- import { StartupCheckStrategy, StartupStatus } from "./startup-check-strategy";
1
+ import type Dockerode from "dockerode";
2
+ import { StartupCheckStrategy, type StartupStatus } from "./startup-check-strategy";
3
3
  export declare class OneShotStartupCheckStrategy extends StartupCheckStrategy {
4
4
  DOCKER_TIMESTAMP_ZERO: string;
5
5
  private isDockerTimestampNonEmpty;
@@ -1,4 +1,4 @@
1
- import Dockerode from "dockerode";
1
+ import type Dockerode from "dockerode";
2
2
  import { AbstractWaitStrategy } from "./wait-strategy";
3
3
  export declare class ShellWaitStrategy extends AbstractWaitStrategy {
4
4
  private readonly command;
@@ -1,8 +1,7 @@
1
- import Dockerode from "dockerode";
1
+ import type Dockerode from "dockerode";
2
2
  import { AbstractWaitStrategy } from "./wait-strategy";
3
3
  export type StartupStatus = "PENDING" | "SUCCESS" | "FAIL";
4
4
  export declare abstract class StartupCheckStrategy extends AbstractWaitStrategy {
5
- constructor();
6
5
  abstract checkStartupState(dockerClient: Dockerode, containerId: string): Promise<StartupStatus>;
7
6
  waitUntilReady(container: Dockerode.Container): Promise<void>;
8
7
  }
@@ -5,9 +5,6 @@ const common_1 = require("../common");
5
5
  const container_runtime_1 = require("../container-runtime");
6
6
  const wait_strategy_1 = require("./wait-strategy");
7
7
  class StartupCheckStrategy extends wait_strategy_1.AbstractWaitStrategy {
8
- constructor() {
9
- super();
10
- }
11
8
  async waitUntilReady(container) {
12
9
  const client = await (0, container_runtime_1.getContainerRuntimeClient)();
13
10
  const startupStatus = await new common_1.IntervalRetry(1000).retryUntil(async () => await this.checkStartupState(client.container.dockerode, container.id), (startupStatus) => startupStatus === "SUCCESS" || startupStatus === "FAIL", () => {
@@ -1,10 +1,8 @@
1
- import { ContainerInspectInfo, HealthConfig, ImageInspectInfo } from "dockerode";
2
- import { HealthCheck, HealthCheckStatus } from "../../types";
1
+ import type { ContainerInspectInfo, HealthConfig, ImageInspectInfo } from "dockerode";
2
+ import type { HealthCheck, HealthCheckStatus } from "../../types";
3
3
  type HealthCheckConfig = HealthConfig | HealthCheck;
4
4
  type HealthCheckInspectInfo = ContainerInspectInfo | ImageInspectInfo;
5
- export declare const isHealthCheckDisabled: (healthCheck: HealthCheckConfig | undefined) => boolean;
6
5
  export declare const hasHealthCheck: (healthCheck: HealthCheckConfig | undefined) => boolean;
7
- export declare const getHealthCheckConfig: (inspectResult: HealthCheckInspectInfo) => HealthConfig | undefined;
8
6
  export declare const hasHealthCheckConfig: (inspectResult: HealthCheckInspectInfo) => boolean;
9
7
  export declare const hasDisabledHealthCheckConfig: (inspectResult: HealthCheckInspectInfo) => boolean;
10
8
  export declare const getHealthCheckStatusFromInspect: (inspectResult: ContainerInspectInfo) => HealthCheckStatus | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasHealthCheckStatus = exports.getHealthCheckStatusFromInspect = exports.hasDisabledHealthCheckConfig = exports.hasHealthCheckConfig = exports.getHealthCheckConfig = exports.hasHealthCheck = exports.isHealthCheckDisabled = void 0;
3
+ exports.hasHealthCheckStatus = exports.getHealthCheckStatusFromInspect = exports.hasDisabledHealthCheckConfig = exports.hasHealthCheckConfig = exports.hasHealthCheck = void 0;
4
4
  const DISABLED_HEALTH_CHECK_TEST = "NONE";
5
5
  const getHealthCheckTest = (healthCheck) => {
6
6
  if ("test" in healthCheck) {
@@ -21,7 +21,6 @@ const isHealthCheckDisabled = (healthCheck) => {
21
21
  }
22
22
  return isDisabledHealthCheck(test);
23
23
  };
24
- exports.isHealthCheckDisabled = isHealthCheckDisabled;
25
24
  const hasHealthCheck = (healthCheck) => {
26
25
  if (healthCheck === undefined) {
27
26
  return false;
@@ -30,7 +29,7 @@ const hasHealthCheck = (healthCheck) => {
30
29
  if (test === undefined || test.length === 0) {
31
30
  return false;
32
31
  }
33
- return !(0, exports.isHealthCheckDisabled)(healthCheck);
32
+ return !isHealthCheckDisabled(healthCheck);
34
33
  };
35
34
  exports.hasHealthCheck = hasHealthCheck;
36
35
  const getHealthCheckConfig = (inspectResult) => {
@@ -42,13 +41,12 @@ const getHealthCheckConfig = (inspectResult) => {
42
41
  inspectWithHealthCheckConfig.Healthcheck ??
43
42
  inspectWithHealthCheckConfig.HealthCheck);
44
43
  };
45
- exports.getHealthCheckConfig = getHealthCheckConfig;
46
44
  const hasHealthCheckConfig = (inspectResult) => {
47
- return (0, exports.hasHealthCheck)((0, exports.getHealthCheckConfig)(inspectResult));
45
+ return (0, exports.hasHealthCheck)(getHealthCheckConfig(inspectResult));
48
46
  };
49
47
  exports.hasHealthCheckConfig = hasHealthCheckConfig;
50
48
  const hasDisabledHealthCheckConfig = (inspectResult) => {
51
- return (0, exports.isHealthCheckDisabled)((0, exports.getHealthCheckConfig)(inspectResult));
49
+ return isHealthCheckDisabled(getHealthCheckConfig(inspectResult));
52
50
  };
53
51
  exports.hasDisabledHealthCheckConfig = hasDisabledHealthCheckConfig;
54
52
  const getHealthCheckStatusFromInspect = (inspectResult) => {
@@ -1,5 +1,5 @@
1
- import Dockerode from "dockerode";
2
- import { ContainerRuntimeClient } from "../../container-runtime";
1
+ import type Dockerode from "dockerode";
2
+ import type { ContainerRuntimeClient } from "../../container-runtime";
3
3
  export interface PortCheck {
4
4
  isBound(port: number | string): Promise<boolean>;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InternalPortCheck = exports.HostPortCheck = void 0;
4
- const net_1 = require("net");
4
+ const node_net_1 = require("node:net");
5
5
  const common_1 = require("../../common");
6
6
  class HostPortCheck {
7
7
  client;
@@ -14,7 +14,7 @@ class HostPortCheck {
14
14
  return Promise.resolve(true);
15
15
  }
16
16
  return new Promise((resolve) => {
17
- const socket = new net_1.Socket();
17
+ const socket = new node_net_1.Socket();
18
18
  const portNumber = typeof port === "string" ? parseInt(port.split("/")[0], 10) : port;
19
19
  socket
20
20
  .setTimeout(1000)
@@ -1,4 +1,4 @@
1
- import { Dispatcher } from "undici";
1
+ import type { Dispatcher } from "undici";
2
2
  /**
3
3
  * Converts an undici response to a fetch response.
4
4
  * This is necessary because node's fetch does not support disabling SSL validation (https://github.com/orgs/nodejs/discussions/44038).
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.undiciResponseToFetchResponse = undiciResponseToFetchResponse;
4
- const stream_1 = require("stream");
4
+ const node_stream_1 = require("node:stream");
5
5
  /**
6
6
  * Converts an undici response to a fetch response.
7
7
  * This is necessary because node's fetch does not support disabling SSL validation (https://github.com/orgs/nodejs/discussions/44038).
@@ -25,6 +25,6 @@ function undiciResponseToFetchResponse(undiciResponse) {
25
25
  }
26
26
  const status = undiciResponse.statusCode;
27
27
  const hasNullBody = status === 204 || status === 205 || status === 304;
28
- const responseBody = hasNullBody ? null : stream_1.Readable.toWeb(undiciResponse.body);
28
+ const responseBody = hasNullBody ? null : node_stream_1.Readable.toWeb(undiciResponse.body);
29
29
  return new Response(responseBody, { status, headers });
30
30
  }
@@ -1,7 +1,7 @@
1
- import { ContainerInspectInfo } from "dockerode";
2
- import { ContainerRuntimeClient } from "../../container-runtime";
3
- import { HealthCheck } from "../../types";
4
- import { WaitStrategy } from "../wait-strategy";
1
+ import type { ContainerInspectInfo } from "dockerode";
2
+ import { type ContainerRuntimeClient } from "../../container-runtime";
3
+ import type { HealthCheck } from "../../types";
4
+ import type { WaitStrategy } from "../wait-strategy";
5
5
  type WaitStrategySelectorOptions = {
6
6
  client: ContainerRuntimeClient;
7
7
  inspectResult: ContainerInspectInfo;
@@ -1,5 +1,5 @@
1
- import { Container } from "dockerode";
2
- import { ContainerRuntimeClient } from "../container-runtime";
3
- import { BoundPorts } from "../utils/bound-ports";
4
- import { WaitStrategy } from "./wait-strategy";
1
+ import type { Container } from "dockerode";
2
+ import type { ContainerRuntimeClient } from "../container-runtime";
3
+ import type { BoundPorts } from "../utils/bound-ports";
4
+ import type { WaitStrategy } from "./wait-strategy";
5
5
  export declare const waitForContainer: (client: ContainerRuntimeClient, container: Container, waitStrategy: WaitStrategy, boundPorts: BoundPorts, startTime?: Date) => Promise<void>;
@@ -1,5 +1,5 @@
1
- import Dockerode from "dockerode";
2
- import { BoundPorts } from "../utils/bound-ports";
1
+ import type Dockerode from "dockerode";
2
+ import type { BoundPorts } from "../utils/bound-ports";
3
3
  export interface WaitStrategy {
4
4
  waitUntilReady(container: Dockerode.Container, boundPorts: BoundPorts, startTime?: Date): Promise<void>;
5
5
  withStartupTimeout(startupTimeoutMs: number): WaitStrategy;
@@ -1,8 +1,8 @@
1
1
  import { CompositeWaitStrategy } from "./composite-wait-strategy";
2
- import { HttpWaitStrategy, HttpWaitStrategyOptions } from "./http-wait-strategy";
3
- import { Log } from "./log-wait-strategy";
2
+ import { HttpWaitStrategy, type HttpWaitStrategyOptions } from "./http-wait-strategy";
3
+ import { type Log } from "./log-wait-strategy";
4
4
  import { ShellWaitStrategy } from "./shell-wait-strategy";
5
- import { WaitStrategy } from "./wait-strategy";
5
+ import type { WaitStrategy } from "./wait-strategy";
6
6
  export declare class Wait {
7
7
  static forAll(waitStrategies: WaitStrategy[]): CompositeWaitStrategy;
8
8
  static forListeningPorts(): WaitStrategy;
@@ -8,6 +8,7 @@ const http_wait_strategy_1 = require("./http-wait-strategy");
8
8
  const log_wait_strategy_1 = require("./log-wait-strategy");
9
9
  const one_shot_startup_startegy_1 = require("./one-shot-startup-startegy");
10
10
  const shell_wait_strategy_1 = require("./shell-wait-strategy");
11
+ // biome-ignore lint/complexity/noStaticOnlyClass: public API surface, kept as a class for backwards compatibility
11
12
  class Wait {
12
13
  static forAll(waitStrategies) {
13
14
  return new composite_wait_strategy_1.CompositeWaitStrategy(waitStrategies);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testcontainers",
3
- "version": "12.2.0",
3
+ "version": "12.2.1",
4
4
  "author": "Cristian Greco",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -44,7 +44,7 @@
44
44
  "ssh-remote-port-forward": "^1.0.4",
45
45
  "tar-fs": "^3.1.3",
46
46
  "tmp": "^0.2.7",
47
- "undici": "^8.10.2"
47
+ "undici": "^8.11.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/archiver": "^7.0.0",
@@ -52,7 +52,6 @@
52
52
  "@types/byline": "^4.2.36",
53
53
  "@types/debug": "^4.1.13",
54
54
  "@types/proper-lockfile": "^4.1.4",
55
- "@types/properties-reader": "^2.1.3",
56
55
  "@types/tar-fs": "^2.0.4",
57
56
  "@types/tmp": "^0.2.6"
58
57
  },
@@ -1,6 +0,0 @@
1
- import { Readable } from "stream";
2
- type Options = {
3
- trim: boolean;
4
- };
5
- export declare const streamToString: (stream: Readable, options?: Options) => Promise<string>;
6
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamToString = void 0;
4
- const streamToString = async (stream, options = { trim: false }) => {
5
- const chunks = [];
6
- for await (const chunk of stream) {
7
- chunks.push(Buffer.from(chunk));
8
- }
9
- const str = Buffer.concat(chunks).toString("utf-8");
10
- return options.trim ? str.trim() : str;
11
- };
12
- exports.streamToString = streamToString;