Skip to content

Commit

Permalink
chore(test-utils): update tescontainers lib and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rudemex committed Aug 14, 2023
1 parent ad72205 commit eed3427
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
]
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.378.0",
"@aws-sdk/client-dynamodb": "^3.391.0",
"@nestjs/axios": "^3.0.0",
"@nestjs/class-validator": "^0.13.3",
"@nestjs/common": "^10.1.2",
Expand All @@ -85,7 +85,7 @@
"redis": "^4.6.7",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.5.5",
"testcontainers": "^9.12.0",
"testcontainers": "^10.2.1",
"typeorm": "^0.3.17",
"uuid": "^9.0.0"
},
Expand Down Expand Up @@ -127,19 +127,19 @@
"@types/pug": "^2.0.6",
"@types/supertest": "^2.0.11",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.3",
"jest": "^29.6.2",
"jest-extended": "^4.0.1",
"jest-junit": "^16.0.0",
"jest-mock-extended": "^3.0.1",
"jest-sonar-reporter": "^2.0.0",
"lerna": "^4.0.0",
"lint-staged": "^13.2.1",
"lint-staged": "^14.0.0",
"mocha": "^10.2.0",
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.3.0",
Expand All @@ -149,7 +149,7 @@
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"supertest": "^6.2.2",
"testcontainers": "^9.12.0",
"testcontainers": "^10.2.1",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"directory": "../../dist/dynamoose"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": "^3.378.0",
"@aws-sdk/client-dynamodb": "^3.391.0",
"@nestjs/common": "^10.1.2",
"@nestjs/core": "^10.1.2",
"@nestjs/platform-express": "^10.1.2",
Expand All @@ -47,7 +47,7 @@
"rxjs": "^7.5.5"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.378.0",
"@aws-sdk/client-dynamodb": "^3.391.0",
"dynamoose": "^3.2.0",
"dynamoose-logger": "^3.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@nestjs/platform-express": "^10.1.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.5.5",
"testcontainers": "^9.12.0"
"testcontainers": "^10.2.1"
},
"dependencies": {
"testcontainers": "^9.12.0"
"testcontainers": "^10.2.1"
},
"devDependencies": {
"@tresdoce-nestjs-toolkit/config": "^0.3.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/test-utils/src/__test__/testcontainer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { testContainers } from '../testcontainers';
import { StartedGenericContainer } from 'testcontainers/dist/src/generic-container/started-generic-container';

import { StartedGenericContainer } from 'testcontainers/build/generic-container/started-generic-container';
import {
TCRedisOptions,
TCDynamoDBOptions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DockerComposeEnvironment } from 'testcontainers';
import { DockerComposeDownOptions } from 'testcontainers/dist/src/docker-compose/docker-compose-options';
import { StartedDockerComposeEnvironment } from 'testcontainers/dist/src/docker-compose-environment/started-docker-compose-environment';
import { DockerComposeEnvironment, StartedDockerComposeEnvironment } from 'testcontainers';
import { ComposeDownOptions } from 'testcontainers/build/container-runtime';
import _ from 'lodash';

let environment: StartedDockerComposeEnvironment;
Expand Down Expand Up @@ -29,7 +28,7 @@ export const initDockerCompose = (
};
};

export const closeDockerCompose = (_options?: Partial<DockerComposeDownOptions>) => {
export const closeDockerCompose = (_options?: Partial<ComposeDownOptions>) => {
return async (): Promise<void> => {
console.info('🐳 Terminate docker-compose...');
try {
Expand Down
13 changes: 10 additions & 3 deletions packages/test-utils/src/testcontainers/testContainersTD.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { GenericContainer, StartedTestContainer, TestContainer, Wait } from 'testcontainers';
import { RandomUuid } from 'testcontainers/dist/src/uuid';
import { StopOptions } from 'testcontainers/dist/src/test-container';
import {
GenericContainer,
RandomUuid,
StartedTestContainer,
StopOptions,
TestContainer,
Wait,
} from 'testcontainers';
import _ from 'lodash';

import { ITestContainerOptions, Env } from './types';
Expand All @@ -23,6 +28,7 @@ export default class TestContainersTD {
/**
* Get instance
*/

/* istanbul ignore next */
public static getInstance(_image?: string, _options?: ITestContainerOptions): TestContainersTD {
return (
Expand Down Expand Up @@ -119,6 +125,7 @@ export default class TestContainersTD {
/**
* Get envs
*/

/* istanbul ignore next */
public getEnvs(): Env {
return _.has(this._options, 'envs') ? this._options.envs : null;
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/testcontainers/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PortWithOptionalBinding } from 'testcontainers/dist/src/port';
import { PortWithOptionalBinding } from 'testcontainers/build/utils/port';

export declare type Env = {
[key in string]: any;
Expand Down

0 comments on commit eed3427

Please sign in to comment.