@kiwiproject/kiwi-test-js 0.6.0 → 1.0.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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ### KiwiTestJS
2
- [![Build](https://github.com/kiwiproject/kiwi-test-js/workflows/build/badge.svg)](https://github.com/kiwiproject/kiwi-test-js/actions?query=workflow%3Abuild)
2
+ [![Build](https://github.com/kiwiproject/kiwi-test-js/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/kiwiproject/kiwi-test-js/actions/workflows/build.yml?query=branch%3Amain)
3
3
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kiwiproject_kiwi-test-js&metric=alert_status)](https://sonarcloud.io/dashboard?id=kiwiproject_kiwi-test-js)
4
4
  [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=kiwiproject_kiwi-test-js&metric=coverage)](https://sonarcloud.io/dashboard?id=kiwiproject_kiwi-test-js)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Starts an Elastic search container and stores the container information in global.ELASTIC_SEARCH_CONTAINER.
3
3
  *
4
- * @param image The image name/version to use for elastic search. Defaults to elasticsearch:8.6.1.
4
+ * @param image The image name/version to use for elastic search. Defaults to elasticsearch:9.0.2.
5
5
  */
6
6
  declare function startElasticSearchContainer(image?: string): Promise<void>;
7
7
  /**
@@ -16,10 +16,10 @@ const elasticsearch_2 = require("@elastic/elasticsearch");
16
16
  /**
17
17
  * Starts an Elastic search container and stores the container information in global.ELASTIC_SEARCH_CONTAINER.
18
18
  *
19
- * @param image The image name/version to use for elastic search. Defaults to elasticsearch:8.6.1.
19
+ * @param image The image name/version to use for elastic search. Defaults to elasticsearch:9.0.2.
20
20
  */
21
- function startElasticSearchContainer(image = "elasticsearch:8.6.1") {
22
- return __awaiter(this, void 0, void 0, function* () {
21
+ function startElasticSearchContainer() {
22
+ return __awaiter(this, arguments, void 0, function* (image = "elasticsearch:9.0.2") {
23
23
  const container = yield new elasticsearch_1.ElasticsearchContainer(image)
24
24
  .withEnvironment({ "xpack.security.enabled": "false" })
25
25
  .start();
@@ -19,8 +19,8 @@ const testcontainers_1 = require("testcontainers");
19
19
  * @param secretKey The secret key configured to connect. Defaults to keyboard cat.
20
20
  * @param image The image name/version to use for minio. Defaults to minio/minio:RELEASE.2023-08-09T23-30-22Z.
21
21
  */
22
- function startMinioContainer(accessKey = "minioadmin", secretKey = "keyboard cat", image = "minio/minio:RELEASE.2023-08-09T23-30-22Z") {
23
- return __awaiter(this, void 0, void 0, function* () {
22
+ function startMinioContainer() {
23
+ return __awaiter(this, arguments, void 0, function* (accessKey = "minioadmin", secretKey = "keyboard cat", image = "minio/minio:RELEASE.2023-08-09T23-30-22Z") {
24
24
  const container = yield new testcontainers_1.GenericContainer(image)
25
25
  .withEnvironment({
26
26
  MINIO_BROWSER: "off",
@@ -18,8 +18,8 @@ const mongodb_1 = require("mongodb");
18
18
  *
19
19
  * @param image The image name/version to use for mongo. Defaults to mongo:6.
20
20
  */
21
- function startMongoContainer(image = "mongo:6") {
22
- return __awaiter(this, void 0, void 0, function* () {
21
+ function startMongoContainer() {
22
+ return __awaiter(this, arguments, void 0, function* (image = "mongo:6") {
23
23
  const container = yield new testcontainers_1.GenericContainer(image)
24
24
  .withExposedPorts(27017)
25
25
  .start();
@@ -18,8 +18,8 @@ const pg_1 = require("pg");
18
18
  *
19
19
  * @param image The image name/version to use for postgres. Defaults to postgres:15.
20
20
  */
21
- function startPostgresContainer(image = "postgres:15") {
22
- return __awaiter(this, void 0, void 0, function* () {
21
+ function startPostgresContainer() {
22
+ return __awaiter(this, arguments, void 0, function* (image = "postgres:15") {
23
23
  const container = yield new postgresql_1.PostgreSqlContainer(image).start();
24
24
  process.env.POSTGRES_EXTENSION_BASE_URI = container.getConnectionUri();
25
25
  // NOTE: This will only work if tests are runInBand (i.e. not in parallel)
@@ -18,8 +18,8 @@ const redis_1 = require("redis");
18
18
  *
19
19
  * @param image The image name/version to use for redis. Defaults to redis:7.
20
20
  */
21
- function startRedisContainer(image = "redis:7") {
22
- return __awaiter(this, void 0, void 0, function* () {
21
+ function startRedisContainer() {
22
+ return __awaiter(this, arguments, void 0, function* (image = "redis:7") {
23
23
  const container = yield new testcontainers_1.GenericContainer(image)
24
24
  .withExposedPorts(6379)
25
25
  .start();
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.wait = void 0;
15
+ exports.wait = wait;
16
16
  const convert_1 = __importDefault(require("convert"));
17
17
  /**
18
18
  * Creates a new wait condition with defaults.
@@ -22,7 +22,6 @@ const convert_1 = __importDefault(require("convert"));
22
22
  function wait() {
23
23
  return new WaitFor();
24
24
  }
25
- exports.wait = wait;
26
25
  class WaitFor {
27
26
  constructor() {
28
27
  this.timeoutMs = 4000;
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "name": "@kiwiproject/kiwi-test-js",
3
- "version": "0.6.0",
3
+ "version": "1.0.0",
4
4
  "description": "kiwi-test-js is a test utility library. Most of these utilities are ports from the Java Kiwi-test library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "/dist"
9
9
  ],
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/kiwiproject/kiwi-test-js.git"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true
17
+ },
10
18
  "scripts": {
11
- "format": "node node_modules/.bin/prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
12
- "lint": "node node_modules/.bin/eslint --ext .js,.ts .",
13
- "test": "node --experimental-vm-modules node_modules/.bin/jest --coverage --collectCoverageFrom=src/**/*.ts"
19
+ "build": "tsc",
20
+ "format": "npx prettier --ignore-path .gitignore --write \"**/*.+(ts|js|json)\"",
21
+ "lint": "npx eslint --fix src",
22
+ "test": "npx jest --coverage --collectCoverageFrom=src/**/*.ts"
14
23
  },
15
24
  "jest": {
16
25
  "testPathIgnorePatterns": [
@@ -22,29 +31,34 @@
22
31
  ]
23
32
  },
24
33
  "dependencies": {
25
- "@elastic/elasticsearch": "8.12.2",
26
- "@jest/globals": "29.7.0",
27
- "@kiwiproject/kiwi-js": "0.10.0",
28
- "@testcontainers/elasticsearch": "10.7.2",
29
- "@testcontainers/postgresql": "10.7.2",
30
- "convert": "5.0.0",
31
- "jest": "29.7.0",
32
- "mongodb": "6.5.0",
33
- "pg": "8.11.3",
34
- "redis": "4.6.13",
35
- "testcontainers": "10.7.2"
34
+ "@elastic/elasticsearch": "9.2.0",
35
+ "@jest/globals": "30.2.0",
36
+ "@kiwiproject/kiwi-js": "1.0.0",
37
+ "@testcontainers/elasticsearch": "11.11.0",
38
+ "@testcontainers/postgresql": "11.11.0",
39
+ "convert": "6.0.0",
40
+ "jest": "30.2.0",
41
+ "mongodb": "7.0.0",
42
+ "pg": "8.17.1",
43
+ "redis": "5.10.0",
44
+ "testcontainers": "11.11.0"
36
45
  },
37
46
  "devDependencies": {
38
- "@babel/core": "7.24.0",
39
- "@babel/preset-env": "7.24.0",
40
- "@babel/preset-typescript": "7.23.3",
41
- "@types/node": "20.11.28",
42
- "@types/pg": "8.11.2",
43
- "@typescript-eslint/eslint-plugin": "7.2.0",
44
- "@typescript-eslint/parser": "7.2.0",
45
- "babel-jest": "29.7.0",
46
- "eslint": "8.57.0",
47
- "prettier": "3.2.5",
48
- "typescript": "5.4.2"
47
+ "@babel/core": "7.28.6",
48
+ "semantic-release": "25.0.2",
49
+ "@babel/preset-env": "7.28.6",
50
+ "@babel/preset-typescript": "7.28.5",
51
+ "@eslint/eslintrc": "3.3.3",
52
+ "@eslint/js": "9.39.2",
53
+ "@types/node": "25.0.9",
54
+ "@types/pg": "8.16.0",
55
+ "babel-jest": "30.2.0",
56
+ "eslint": "9.39.2",
57
+ "eslint-config-prettier": "10.1.8",
58
+ "eslint-plugin-prettier": "5.5.5",
59
+ "globals": "17.0.0",
60
+ "prettier": "3.8.0",
61
+ "typescript": "5.9.3",
62
+ "typescript-eslint": "8.53.0"
49
63
  }
50
64
  }