Skip to content

Commit 69b1a03

Browse files
committed
docs(mongo-memory-server): add notes about when a new port gets generated
1 parent 1170ad5 commit 69b1a03

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/api/classes/mongo-memory-server.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Typings: `async start(forceSamePort: boolean = false): Promise<boolean>`
3737

3838
Used to start an new Instance or to Re-Start an stopped instance
3939

40+
with `forceSamePort` set to `true` and having `instance.port` set, it will use that port and not generate a new port.
41+
with `forceSamePort` set to `true` and not having `instance.port` set, it will generate a new free port.
42+
4043
:::caution
4144
Will Error if instance is already running
4245
:::
@@ -53,7 +56,10 @@ Finds an new non-locked port
5356

5457
<span class="badge badge--warning">Internal</span>
5558

56-
Typings: `protected async getStartOptions(): Promise<MongoMemoryServerGetStartOptions>`
59+
Typings: `protected async getStartOptions(forceSamePort: boolean = false): Promise<MongoMemoryServerGetStartOptions>`
60+
61+
with `forceSamePort` set to `true` and having `instance.port` set, it will use that port and not generate a new port.
62+
with `forceSamePort` set to `true` and not having `instance.port` set, it will generate a new free port.
5763

5864
Constructs the Starting Options
5965

@@ -71,6 +77,8 @@ Typings: `async stop(runCleanup: boolean = true): Promise<boolean>`
7177

7278
Stop an running instance
7379

80+
with `runCleanup` will run [`.cleanup`](#cleanup) after stopping with `force = false`
81+
7482
:::caution
7583
Will not Error if instance is not running
7684
:::

0 commit comments

Comments
 (0)