@tsed/testcontainers-mongo 8.28.8 → 8.29.1
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/package.json +9 -9
- package/readme.md +10 -11
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@tsed/testcontainers-mongo",
|
|
3
3
|
"description": "A module to test Ts.ED code that use MongoDB as database using Test Containers",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.29.1",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
|
-
"main": "
|
|
8
|
-
"module": "
|
|
7
|
+
"main": "lib/esm/index.js",
|
|
8
|
+
"module": "lib/esm/index.js",
|
|
9
9
|
"typings": "./lib/types/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@testcontainers/mongodb": "^10.13.2",
|
|
34
|
-
"@tsed/barrels": "8.
|
|
35
|
-
"@tsed/core": "8.
|
|
36
|
-
"@tsed/di": "8.
|
|
37
|
-
"@tsed/platform-http": "8.
|
|
38
|
-
"@tsed/typescript": "8.
|
|
34
|
+
"@tsed/barrels": "8.29.1",
|
|
35
|
+
"@tsed/core": "8.29.1",
|
|
36
|
+
"@tsed/di": "8.29.1",
|
|
37
|
+
"@tsed/platform-http": "8.29.1",
|
|
38
|
+
"@tsed/typescript": "8.29.1",
|
|
39
39
|
"eslint": "9.12.0",
|
|
40
40
|
"mongodb": "6.9.0",
|
|
41
41
|
"testcontainers": ">=10.11.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
55
55
|
},
|
|
56
|
-
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/
|
|
56
|
+
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/testcontainers/mongo",
|
|
57
57
|
"author": "Romain Lenzotti",
|
|
58
58
|
"license": "MIT"
|
|
59
59
|
}
|
package/readme.md
CHANGED
|
@@ -36,26 +36,25 @@ This package allows you to test your code using the [TestContainers](https://nod
|
|
|
36
36
|
To use the `@tsed/testcontainers-mongo` package, you need to install the package:
|
|
37
37
|
|
|
38
38
|
```sh [npm]
|
|
39
|
-
npm install --save-dev @tsed/
|
|
39
|
+
npm install --save-dev @tsed/mongo
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
```sh [yarn]
|
|
43
|
-
yarn add --dev @tsed/
|
|
43
|
+
yarn add --dev @tsed/mongo
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
```sh [pnpm]
|
|
47
|
-
pnpm add --dev @tsed/
|
|
47
|
+
pnpm add --dev @tsed/mongo
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
```sh [bun]
|
|
51
|
-
bun add --dev @tsed/
|
|
51
|
+
bun add --dev @tsed/mongo
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
### Important
|
|
55
55
|
|
|
56
56
|
This package requires the `@tsed/platform-http` package to work properly. If you're looking for a standalone package,
|
|
57
|
-
you can use the `@tsedio/testcontainers-mongo` premium package available
|
|
58
|
-
here: https://tsed.dev/plugins/premium/config-source/mongo.html
|
|
57
|
+
you can use the `@tsedio/testcontainers-mongo` premium package available here: https://tsed.dev/plugins/premium/config-source/mongo.html
|
|
59
58
|
|
|
60
59
|
### Configuration
|
|
61
60
|
|
|
@@ -71,13 +70,13 @@ module.exports = {
|
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
// jest.setup.js
|
|
74
|
-
const {TestContainersMongo} = require("@tsed/
|
|
73
|
+
const {TestContainersMongo} = require("@tsed/mongo");
|
|
75
74
|
module.exports = async () => {
|
|
76
75
|
await TestContainersMongo.startMongoServer();
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
// jest.teardown.js
|
|
80
|
-
const {TestContainersMongo} = require("@tsed/
|
|
79
|
+
const {TestContainersMongo} = require("@tsed/mongo");
|
|
81
80
|
module.exports = async () => {
|
|
82
81
|
await TestContainersMongo.stopMongoServer();
|
|
83
82
|
};
|
|
@@ -90,7 +89,7 @@ import {defineConfig} from "vitest/config";
|
|
|
90
89
|
|
|
91
90
|
export default defineConfig({
|
|
92
91
|
test: {
|
|
93
|
-
globalSetup: [import.meta.resolve("@tsed/
|
|
92
|
+
globalSetup: [import.meta.resolve("@tsed/mongo/vitest/setup")]
|
|
94
93
|
}
|
|
95
94
|
});
|
|
96
95
|
```
|
|
@@ -109,7 +108,7 @@ Use the `TestContainersMongo.create` method to start the mongo server before you
|
|
|
109
108
|
import {PlatformTest} from "@tsed/platform-http/testing";
|
|
110
109
|
import {Property, Required} from "@tsed/schema";
|
|
111
110
|
import {Model, MongooseModel, ObjectID, PostHook, PreHook, Unique} from "@tsed/mongoose";
|
|
112
|
-
import {TestContainersMongo} from "@tsed/
|
|
111
|
+
import {TestContainersMongo} from "@tsed/mongo";
|
|
113
112
|
|
|
114
113
|
@Model({schemaOptions: {timestamps: true}})
|
|
115
114
|
@PreHook("save", (user: UserModel, next: any) => {
|
|
@@ -176,7 +175,7 @@ TestContainersMongo provides a method to get the connection options for MikroORM
|
|
|
176
175
|
import {EntityManager, MikroORM} from "@mikro-orm/core";
|
|
177
176
|
import {defineConfig} from "@mikro-orm/mongodb";
|
|
178
177
|
import {PlatformTest} from "@tsed/platform-http/testing";
|
|
179
|
-
import {TestContainersMongo} from "@tsed/
|
|
178
|
+
import {TestContainersMongo} from "@tsed/mongo";
|
|
180
179
|
|
|
181
180
|
beforeEach(async () => {
|
|
182
181
|
const mongoSettings = TestContainersMongo.getMongoConnectionOptions();
|