0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed test that left an instance of ghost running (#21178)

no issue

- This test file starts a Ghost server, but doesn't close it, which can
cause other tests to fail when they try to start an instance of Ghost,
with an `EADDRINUSE` error.
- This change closes the server in the `after` hook
This commit is contained in:
Chris Raible 2024-10-01 17:22:48 -07:00 committed by GitHub
parent 6965254b3f
commit bf7320cfb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,11 +8,11 @@ const membersEventsService = require('../../core/server/services/members-events'
describe('Click Tracking', function () {
let agent;
let ghostServer;
let webhookMockReceiver;
before(async function () {
const {adminAgent} = await agentProvider.getAgentsWithFrontend();
agent = adminAgent;
({adminAgent: agent, ghostServer} = await agentProvider.getAgentsWithFrontend());
await fixtureManager.init('newsletters', 'members:newsletters', 'integrations');
await agent.loginAsOwner();
});
@ -28,6 +28,10 @@ describe('Click Tracking', function () {
mockManager.restore();
});
after(async function () {
await ghostServer.stop();
});
it('Full test', async function () {
const siteUrl = new URL(urlUtils.urlFor('home', true));