
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
testcontainers-mailhog
Advanced tools
A testcontainers for mailhog
https://www.npmjs.com/package/testcontainers-mailhog
npm i -D testcontainers-mailhog
DEBUG=testcontainers Enable testcontainers logsDEBUG=testcontainers:containers Enable container logsDEBUG=testcontainers* Enable all logsTESTCONTAINERS_RYUK_DISABLED=true Disable ryukRYUK_CONTAINER_IMAGE=registry.mycompany.com/mirror/ryuk:0.3.0 Custom image for ryuk.getAllMessages() Lists all messages excluding message content.getMessage(messageId) Returns an individual message including message content.deleteAllMessages() Deletes all messages.deleteMessage(messageId) Delete an individual message.getMappedSmtpPort() Get mapped smtp port, for configure smtp client.getMappedApiPort() Get mapped api port, if u want to invoke api manuallyTest with vitest
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest'
import {
MailhogContainer,
StartedMailhogContainer
} from 'testcontainers-mailhog'
describe('Mailing test', () => {
let mailhogContainer: StartedMailhogContainer
beforeAll(async () => {
const imageName = 'harbor.yourcompany.com/mailhog'
mailhogContainer = await new MailhogContainer(imageName).start()
})
afterAll(async () => {
await mailhogContainer.stop()
})
afterEach(async () => {
await mailhogContainer.deleteAllMessages()
})
test('some case with mailing', async () => {
// const smtpUrl = `${mailhogContainer.getHost()}:${mailhogContainer.getMappedSmtpPort()}`
// ...
})
})
See test cases for the example with nodemailer
FAQs
A Testcontainers implementation for Mailhog
The npm package testcontainers-mailhog receives a total of 4 weekly downloads. As such, testcontainers-mailhog popularity was classified as not popular.
We found that testcontainers-mailhog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.