@amqp-contract/testing 0.0.4 → 0.0.6

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.
@@ -1,10 +1,8 @@
1
1
  import * as vitest0 from "vitest";
2
- import { ChannelModel } from "amqplib";
3
2
 
4
3
  //#region src/extension.d.ts
5
4
  declare const it: vitest0.TestAPI<{
6
- workerConnection: ChannelModel;
7
- clientConnection: ChannelModel;
5
+ amqpConnectionUrl: string;
8
6
  }>;
9
7
  //#endregion
10
8
  export { it };
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.mts","names":[],"sources":["../src/extension.ts"],"sourcesContent":[],"mappings":";;;;cAGa,YAAE;;;AAAf,CAAA,CAAA"}
1
+ {"version":3,"file":"extension.d.mts","names":[],"sources":["../src/extension.ts"],"sourcesContent":[],"mappings":";;;cAEa,IAQX,OAAA,CARa"}
@@ -1,26 +1,9 @@
1
1
  import { inject, it as it$1 } from "vitest";
2
- import { connect } from "amqplib";
3
2
 
4
3
  //#region src/extension.ts
5
- const it = it$1.extend({
6
- workerConnection: async ({}, use) => {
7
- const connection = await createAmqpConnection();
8
- await use(connection);
9
- try {
10
- await connection.close();
11
- } catch {}
12
- },
13
- clientConnection: async ({}, use) => {
14
- const connection = await createAmqpConnection();
15
- await use(connection);
16
- try {
17
- await connection.close();
18
- } catch {}
19
- }
20
- });
21
- function createAmqpConnection() {
22
- return connect(`amqp://guest:guest@${inject("__TESTCONTAINERS_RABBITMQ_IP__")}:${inject("__TESTCONTAINERS_RABBITMQ_PORT_5672__")}`);
23
- }
4
+ const it = it$1.extend({ amqpConnectionUrl: async ({}, use) => {
5
+ await use(`amqp://guest:guest@${inject("__TESTCONTAINERS_RABBITMQ_IP__")}:${inject("__TESTCONTAINERS_RABBITMQ_PORT_5672__")}`);
6
+ } });
24
7
 
25
8
  //#endregion
26
9
  export { it };
@@ -1 +1 @@
1
- {"version":3,"file":"extension.mjs","names":["vitestIt"],"sources":["../src/extension.ts"],"sourcesContent":["import { inject, it as vitestIt } from \"vitest\";\nimport { type ChannelModel, connect } from \"amqplib\";\n\nexport const it = vitestIt.extend<{\n workerConnection: ChannelModel;\n clientConnection: ChannelModel;\n}>({\n // oxlint-disable-next-line no-empty-pattern\n workerConnection: async ({}, use) => {\n const connection = await createAmqpConnection();\n await use(connection);\n try {\n await connection.close();\n } catch {\n // Connection may already be closed\n }\n },\n // oxlint-disable-next-line no-empty-pattern\n clientConnection: async ({}, use) => {\n const connection = await createAmqpConnection();\n await use(connection);\n try {\n await connection.close();\n } catch {\n // Connection may already be closed\n }\n },\n});\n\nfunction createAmqpConnection(): Promise<ChannelModel> {\n return connect(\n `amqp://guest:guest@${inject(\"__TESTCONTAINERS_RABBITMQ_IP__\")}:${inject(\"__TESTCONTAINERS_RABBITMQ_PORT_5672__\")}`,\n );\n}\n"],"mappings":";;;;AAGA,MAAa,KAAKA,KAAS,OAGxB;CAED,kBAAkB,OAAO,IAAI,QAAQ;EACnC,MAAM,aAAa,MAAM,sBAAsB;AAC/C,QAAM,IAAI,WAAW;AACrB,MAAI;AACF,SAAM,WAAW,OAAO;UAClB;;CAKV,kBAAkB,OAAO,IAAI,QAAQ;EACnC,MAAM,aAAa,MAAM,sBAAsB;AAC/C,QAAM,IAAI,WAAW;AACrB,MAAI;AACF,SAAM,WAAW,OAAO;UAClB;;CAIX,CAAC;AAEF,SAAS,uBAA8C;AACrD,QAAO,QACL,sBAAsB,OAAO,iCAAiC,CAAC,GAAG,OAAO,wCAAwC,GAClH"}
1
+ {"version":3,"file":"extension.mjs","names":["vitestIt"],"sources":["../src/extension.ts"],"sourcesContent":["import { inject, it as vitestIt } from \"vitest\";\n\nexport const it = vitestIt.extend<{\n amqpConnectionUrl: string;\n}>({\n // oxlint-disable-next-line no-empty-pattern\n amqpConnectionUrl: async ({}, use) => {\n const url = `amqp://guest:guest@${inject(\"__TESTCONTAINERS_RABBITMQ_IP__\")}:${inject(\"__TESTCONTAINERS_RABBITMQ_PORT_5672__\")}`;\n await use(url);\n },\n});\n"],"mappings":";;;AAEA,MAAa,KAAKA,KAAS,OAExB,EAED,mBAAmB,OAAO,IAAI,QAAQ;AAEpC,OAAM,IADM,sBAAsB,OAAO,iCAAiC,CAAC,GAAG,OAAO,wCAAwC,GAC/G;GAEjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amqp-contract/testing",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Testing utilities for AMQP contracts with testcontainers",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,11 +18,9 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "amqplib": "0.10.9",
22
21
  "testcontainers": "11.10.0"
23
22
  },
24
23
  "devDependencies": {
25
- "@types/amqplib": "0.10.8",
26
24
  "tsdown": "0.18.1",
27
25
  "typescript": "5.9.3",
28
26
  "vitest": "4.0.16",