|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | -import * as path from "path"; |
17 | | -import { dirname } from 'path'; |
18 | | -import { fileURLToPath } from 'url'; |
| 16 | +import * as path from "node:path"; |
| 17 | +import { dirname } from 'node:path'; |
| 18 | +import { fileURLToPath } from 'node:url'; |
19 | 19 |
|
20 | 20 | import { jest } from '@jest/globals' |
21 | 21 | import { CreateQueueCommand, ListQueuesCommand, ReceiveMessageCommand, SQSClient, SendMessageCommand } from "@aws-sdk/client-sqs"; |
22 | 22 | import { GenericContainer, Network, Wait } from "testcontainers"; |
23 | 23 | import { LocalstackContainer } from "@testcontainers/localstack"; |
24 | 24 | import { RabbitMQContainer } from "@testcontainers/rabbitmq"; |
25 | | -import { MicrocksContainersEnsemble } from "./microcks-containers-ensemble"; |
26 | | -import { TestRequest, TestResult, TestRunnerType } from "./microcks-container"; |
| 25 | +import { MicrocksContainersEnsemble } from "./microcks-containers-ensemble.js"; |
| 26 | +import { TestRequest, TestResult, TestRunnerType } from "./microcks-container.js"; |
27 | 27 | import { WebSocket } from "ws"; |
28 | | -import mqtt from "mqtt"; |
| 28 | +import mqtt from "mqtt"; |
29 | 29 | import amqp from "amqplib"; |
30 | 30 |
|
31 | 31 | describe("MicrocksContainersEnsemble", () => { |
@@ -143,7 +143,7 @@ describe("MicrocksContainersEnsemble", () => { |
143 | 143 | let wsEndpoint = ensemble.getAsyncMinionContainer()?.getWSMockEndpoint("Pastry orders API", "0.1.0", "SUBSCRIBE pastry/orders"); |
144 | 144 | let expectedMessage = "{\"id\":\"4dab240d-7847-4e25-8ef3-1530687650c8\",\"customerId\":\"fe1088b3-9f30-4dc1-a93d-7b74f0a072b9\",\"status\":\"VALIDATED\",\"productQuantities\":[{\"quantity\":2,\"pastryName\":\"Croissant\"},{\"quantity\":1,\"pastryName\":\"Millefeuille\"}]}"; |
145 | 145 |
|
146 | | - const ws = new WebSocket(wsEndpoint as string); |
| 146 | + const ws = new WebSocket(wsEndpoint as string); |
147 | 147 | ws.on('error', console.error); |
148 | 148 | ws.on('message', function message(data) { |
149 | 149 | messages.push(data.toString()); |
@@ -199,7 +199,7 @@ describe("MicrocksContainersEnsemble", () => { |
199 | 199 | expect(testResult.testCaseResults[0].testStepResults[0].message).toContain("object has missing required properties"); |
200 | 200 |
|
201 | 201 | // Retrieve event messages for the failing test case. |
202 | | - const events = await ensemble.getMicrocksContainer().getEventMessagesForTestCase(testResult, |
| 202 | + const events = await ensemble.getMicrocksContainer().getEventMessagesForTestCase(testResult, |
203 | 203 | "SUBSCRIBE pastry/orders"); |
204 | 204 |
|
205 | 205 | // We should have at least 1 event. |
@@ -326,7 +326,7 @@ describe("MicrocksContainersEnsemble", () => { |
326 | 326 | //await channel.checkExchange(amqpDestination as string); |
327 | 327 | await channel.assertQueue('microcks-test', { durable: false }); |
328 | 328 | await channel.bindQueue('microcks-test', amqpDestination as string, ''); |
329 | | - |
| 329 | + |
330 | 330 | channel.consume('microcks-test', (msg: any) => { |
331 | 331 | if (msg !== null) { |
332 | 332 | messages.push(msg.content.toString()); |
@@ -391,7 +391,7 @@ describe("MicrocksContainersEnsemble", () => { |
391 | 391 | endpointOverride: 'http://localstack:4566' |
392 | 392 | }) |
393 | 393 | .start(); |
394 | | - |
| 394 | + |
395 | 395 | // Initialize messages list and connect to mock endpoint. |
396 | 396 | let messages: string[] = []; |
397 | 397 | let sqsEndpoint = ensemble.getAsyncMinionContainer()?.getAmazonSQSMockQueue("Pastry orders API", "0.1.0", "SUBSCRIBE pastry/orders"); |
|
0 commit comments