Skip to content

Commit 701543c

Browse files
committed
fix: #127 Revert project to CJS and bump node version
Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
1 parent f3a684f commit 701543c

12 files changed

Lines changed: 2435 additions & 3609 deletions

.github/workflows/build-verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
- name: Checkout Code
2222
uses: actions/checkout@v4
2323

24-
- name: Set Node.js 18.x
24+
- name: Set Node.js 20.x
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: 18.x
27+
node-version: 20.x
2828
cache: 'npm'
2929

3030
- name: Dependencies installation

jest.config.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

package-lock.json

Lines changed: 2402 additions & 3574 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "0.3.2-SNAPSHOT",
44
"author": "Laurent Broudoux <laurent@microcks.io>",
55
"description": "Node/TypeScript library for Testcontainers that enables embedding Microcks into your unit tests with lightweight, throwaway instance thanks to containers",
6-
"type": "module",
76
"bugs": {
87
"url": "https://github.com/microcks/microcks-testcontainers-node/issues"
98
},
@@ -20,7 +19,7 @@
2019
"scripts": {
2120
"prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
2221
"build": "tsc --project tsconfig.build.json",
23-
"test": "cross-env DEBUG=testcontainers* NODE_OPTIONS='--experimental-vm-modules' jest"
22+
"test": "cross-env DEBUG=testcontainers* vitest run"
2423
},
2524
"dependencies": {
2625
"testcontainers": "10.16.0"
@@ -34,18 +33,17 @@
3433
"@types/ws": "^8.5.10",
3534
"amqplib": "^0.10.4",
3635
"cross-env": "^7.0.3",
37-
"jest": "^29.7.0",
38-
"keycloak-testcontainer": "^0.0.8",
36+
"keycloak-testcontainer": "^0.0.9",
3937
"mqtt": "^5.10.3",
40-
"ts-jest": "^29.1.1",
4138
"ts-node": "^10.9.1",
4239
"typescript": "^4.9.5",
40+
"vitest": "3.0.8",
4341
"ws": "^8.17.0"
4442
},
4543
"files": [
4644
"build"
4745
],
4846
"engines": {
49-
"node": ">= 16"
47+
"node": ">= 20"
5048
}
5149
}

src/microcks-async-minion-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { AbstractStartedContainer, GenericContainer, StartedNetwork, StartedTestContainer, Wait, getContainerRuntimeClient } from "testcontainers";
17+
import { AbstractStartedContainer, GenericContainer, StartedNetwork, StartedTestContainer, Wait } from "testcontainers";
1818
import { MicrocksContainer } from "./microcks-container";
1919

2020
export class MicrocksAsyncMinionContainer extends GenericContainer {

src/microcks-container.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@
1414
* limitations under the License.
1515
*/
1616
import * as path from "path";
17-
import { dirname } from 'path';
18-
import { fileURLToPath } from 'url';
1917

20-
import { jest } from '@jest/globals'
2118
import { GenericContainer, Network, Wait } from "testcontainers";
2219
import { MicrocksContainer, TestRequest, TestRunnerType, OAuth2GrantType, StartedMicrocksContainer } from "./microcks-container";
2320

2421
import KeycloakContainer from 'keycloak-testcontainer';
2522

2623
describe("MicrocksContainer", () => {
27-
jest.setTimeout(180_000);
28-
29-
const __dirname = dirname(fileURLToPath(import.meta.url));
24+
3025
const resourcesDir = path.resolve(__dirname, "..", "test-resources");
3126

3227
// start and mock {

src/microcks-containers-ensemble.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import * as path from "path";
17-
import { dirname } from 'path';
18-
import { fileURLToPath } from 'url';
1917

20-
import { jest } from '@jest/globals'
2118
import { CreateQueueCommand, ListQueuesCommand, ReceiveMessageCommand, SQSClient, SendMessageCommand } from "@aws-sdk/client-sqs";
2219
import { GenericContainer, Network, Wait } from "testcontainers";
2320
import { LocalstackContainer } from "@testcontainers/localstack";
@@ -29,9 +26,7 @@ import mqtt from "mqtt";
2926
import amqp from "amqplib";
3027

3128
describe("MicrocksContainersEnsemble", () => {
32-
jest.setTimeout(180_000);
33-
34-
const __dirname = dirname(fileURLToPath(import.meta.url));
29+
3530
const resourcesDir = path.resolve(__dirname, "..", "test-resources");
3631

3732
// start and mock {

src/microcks-containers-ensemble.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*/
1616
import { GenericContainer, StartedNetwork, StartedTestContainer, StopOptions, Wait } from "testcontainers";
17-
import { MicrocksContainer, Secret, StartedMicrocksContainer } from "./microcks-container";
17+
import { MicrocksContainer, Secret, StartedMicrocksContainer } from "./microcks-container.js";
1818
import {
1919
AmazonServiceConnection, GenericConnection, KafkaConnection,
2020
MicrocksAsyncMinionContainer, StartedMicrocksAsyncMinionContainer
21-
} from "./microcks-async-minion-container";
21+
} from "./microcks-async-minion-container.js";
2222

2323
export class MicrocksContainersEnsemble {
2424
static readonly MICROCKS_CONTAINER_ALIAS = "microcks";

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const LIB_VERSION = "0.3.1";
1+
export const LIB_VERSION = "0.3.2-SNAPSHOT";

tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"exclude": [
44
"build",
55
"jest.config.ts",
6+
"vite.config.ts",
67
"src/**/*.test.ts"
78
]
89
}

0 commit comments

Comments
 (0)