Skip to content

Commit 46bcb39

Browse files
authored
fix: Rename test container. (#204)
1 parent b27d358 commit 46bcb39

12 files changed

+37
-37
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ controller.abort();
403403

404404
### Using Testcontainers
405405

406-
Import the `EventSourcingDbContainer` class, create an instance, call the `start` function to run a test container, get a client, run your test code, and finally call the `stop` function to stop the test container:
406+
Import the `Container` class, create an instance, call the `start` function to run a test container, get a client, run your test code, and finally call the `stop` function to stop the test container:
407407

408408
```typescript
409-
import { EventSourcingDbContainer } from 'eventsourcingdb';
409+
import { Container } from 'eventsourcingdb';
410410

411-
const container = new EventSourcingDbContainer();
411+
const container = new Container();
412412
await container.start();
413413

414414
const client = container.getClient();
@@ -426,17 +426,17 @@ const isRunning = container.isRunning();
426426

427427
#### Configuring the Container Instance
428428

429-
By default, `EventSourcingDbContainer` uses the `latest` tag of the official EventSourcingDB Docker image. To change that, call the `withImageTag` function:
429+
By default, `Container` uses the `latest` tag of the official EventSourcingDB Docker image. To change that, call the `withImageTag` function:
430430

431431
```typescript
432-
const container = new EventSourcingDbContainer()
432+
const container = new Container()
433433
.withImageTag('1.0.0');
434434
```
435435

436436
Similarly, you can configure the port to use and the API token. Call the `withPort` or the `withApiToken` function respectively:
437437

438438
```typescript
439-
const container = new EventSourcingDbContainer()
439+
const container = new Container()
440440
.withPort(4000)
441441
.withApiToken('secret');
442442
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { StartedTestContainer } from 'testcontainers';
22
import { GenericContainer, Wait } from 'testcontainers';
33
import { Client } from './Client.js';
44

5-
class EventSourcingDbContainer {
5+
class Container {
66
#imageName = 'thenativeweb/eventsourcingdb';
77
#imageTag = 'latest';
88
#internalPort = 3000;
@@ -88,4 +88,4 @@ class EventSourcingDbContainer {
8888
}
8989
}
9090

91-
export { EventSourcingDbContainer };
91+
export { Container };

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Client } from './Client.js';
2+
import { Container } from './Container.js';
23
import type { Event } from './Event.js';
34
import type { EventCandidate } from './EventCandidate.js';
4-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
55
import type { EventType } from './EventType.js';
66
import type { ObserveEventsOptions } from './ObserveEventsOptions.js';
77
import type { ReadEventsOptions } from './ReadEventsOptions.js';
88
import { isSubjectOnEventId } from './isSubjectOnEventId.js';
99
import { isSubjectPristine } from './isSubjectPristine.js';
1010

11-
export { Client, EventSourcingDbContainer, isSubjectPristine, isSubjectOnEventId };
11+
export { Client, Container, isSubjectPristine, isSubjectOnEventId };
1212
export type { Event, EventCandidate, EventType, ReadEventsOptions, ObserveEventsOptions };

src/observeEvents.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3+
import { Container } from './Container.js';
34
import type { Event } from './Event.js';
45
import type { EventCandidate } from './EventCandidate.js';
5-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
66
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
77

88
suite('observeEvents', { timeout: 30_000 }, () => {
9-
let container: EventSourcingDbContainer;
9+
let container: Container;
1010

1111
beforeEach(async () => {
1212
const imageVersion = getImageVersionFromDockerfile();
13-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
13+
container = new Container().withImageTag(imageVersion);
1414
await container.start();
1515
});
1616

src/ping.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
33
import { Client } from './Client.js';
4-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
4+
import { Container } from './Container.js';
55
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
66

77
suite('ping', { timeout: 30_000 }, () => {
8-
let container: EventSourcingDbContainer;
8+
let container: Container;
99

1010
beforeEach(async () => {
1111
const imageVersion = getImageVersionFromDockerfile();
12-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
12+
container = new Container().withImageTag(imageVersion);
1313
await container.start();
1414
});
1515

src/readEventTypes.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3+
import { Container } from './Container.js';
34
import type { EventCandidate } from './EventCandidate.js';
4-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
55
import type { EventType } from './EventType.js';
66
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
77

88
suite('readEventTypes', { timeout: 20_000 }, () => {
9-
let container: EventSourcingDbContainer;
9+
let container: Container;
1010

1111
beforeEach(async () => {
1212
const imageVersion = getImageVersionFromDockerfile();
13-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
13+
container = new Container().withImageTag(imageVersion);
1414
await container.start();
1515
});
1616

src/readEvents.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3+
import { Container } from './Container.js';
34
import type { Event } from './Event.js';
45
import type { EventCandidate } from './EventCandidate.js';
5-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
66
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
77

88
suite('readEvents', { timeout: 30_000 }, () => {
9-
let container: EventSourcingDbContainer;
9+
let container: Container;
1010

1111
beforeEach(async () => {
1212
const imageVersion = getImageVersionFromDockerfile();
13-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
13+
container = new Container().withImageTag(imageVersion);
1414
await container.start();
1515
});
1616

src/readSubjects.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3+
import { Container } from './Container.js';
34
import type { EventCandidate } from './EventCandidate.js';
4-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
55
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
66

77
suite('readSubjects', { timeout: 30_000 }, () => {
8-
let container: EventSourcingDbContainer;
8+
let container: Container;
99

1010
beforeEach(async () => {
1111
const imageVersion = getImageVersionFromDockerfile();
12-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
12+
container = new Container().withImageTag(imageVersion);
1313
await container.start();
1414
});
1515

src/registerEventSchema.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
3+
import { Container } from './Container.js';
44
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
55

66
suite('registerEventSchema', { timeout: 30_000 }, () => {
7-
let container: EventSourcingDbContainer;
7+
let container: Container;
88

99
beforeEach(async () => {
1010
const imageVersion = getImageVersionFromDockerfile();
11-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
11+
container = new Container().withImageTag(imageVersion);
1212
await container.start();
1313
});
1414

src/runEventQlQuery.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import assert from 'node:assert/strict';
22
import { afterEach, beforeEach, suite, test } from 'node:test';
3+
import { Container } from './Container.js';
34
import type { EventCandidate } from './EventCandidate.js';
4-
import { EventSourcingDbContainer } from './EventSourcingDbContainer.js';
55
import { getImageVersionFromDockerfile } from './getImageVersionFromDockerfile.js';
66

77
suite('runEventQlQuery', { timeout: 30_000 }, () => {
8-
let container: EventSourcingDbContainer;
8+
let container: Container;
99

1010
beforeEach(async () => {
1111
const imageVersion = getImageVersionFromDockerfile();
12-
container = new EventSourcingDbContainer().withImageTag(imageVersion);
12+
container = new Container().withImageTag(imageVersion);
1313
await container.start();
1414
});
1515

0 commit comments

Comments
 (0)