@amqp-contract/testing 0.0.5 → 0.1.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/dist/extension.d.mts +1 -3
- package/dist/extension.d.mts.map +1 -1
- package/dist/extension.mjs +3 -20
- package/dist/extension.mjs.map +1 -1
- package/package.json +1 -3
package/dist/extension.d.mts
CHANGED
|
@@ -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
|
-
|
|
7
|
-
clientConnection: ChannelModel;
|
|
5
|
+
amqpConnectionUrl: string;
|
|
8
6
|
}>;
|
|
9
7
|
//#endregion
|
|
10
8
|
export { it };
|
package/dist/extension.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.mts","names":[],"sources":["../src/extension.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extension.d.mts","names":[],"sources":["../src/extension.ts"],"sourcesContent":[],"mappings":";;;cAEa,IAQX,OAAA,CARa"}
|
package/dist/extension.mjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
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 };
|
package/dist/extension.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.mjs","names":["vitestIt"],"sources":["../src/extension.ts"],"sourcesContent":["import { inject, it as vitestIt } from \"vitest\";\
|
|
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
|
|
3
|
+
"version": "0.1.0",
|
|
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",
|