mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-08 23:37:05 +02:00
* Fix playwright flaky tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Wipe mailhog between test runs Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
31 lines
978 B
TypeScript
31 lines
978 B
TypeScript
/*
|
|
Copyright 2024 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait } from "testcontainers";
|
|
import mailhog from "mailhog";
|
|
|
|
export class MailhogContainer extends GenericContainer {
|
|
constructor() {
|
|
super("mailhog/mailhog:latest");
|
|
|
|
this.withExposedPorts(8025).withWaitStrategy(Wait.forListeningPorts());
|
|
}
|
|
|
|
public override async start(): Promise<StartedMailhogContainer> {
|
|
return new StartedMailhogContainer(await super.start());
|
|
}
|
|
}
|
|
|
|
export class StartedMailhogContainer extends AbstractStartedContainer {
|
|
public readonly client: mailhog.API;
|
|
|
|
constructor(container: StartedTestContainer) {
|
|
super(container);
|
|
this.client = mailhog({ host: container.getHost(), port: container.getMappedPort(8025) });
|
|
}
|
|
}
|