Skip to content

Fix backend test suite failures #2136

@trillium

Description

@trillium

Overview

The backend test suite has several pre-existing failures that predate the ESM migration. These need to be resolved so the test suite can serve as a reliable quality gate.

Action Items

  • Router tests (auth, events, projects, users) fail because process.env.CUSTOM_REQUEST_HEADER is undefined — tests should set required env vars themselves
  • models/event.model.test.js and models/projectTeamMember.model.test.js have updatedDate assertions that fail because Mongoose pre-update hooks aren't firing on findOneAndUpdate and updateMany
  • setup-test.js has un-awaited deleteMany() calls causing race conditions between tests
  • MongoMemoryServer teardown produces MongoNetworkError: connection closed errors from parallel test execution
  • Empty describe blocks cause Vitest to fail (Jest silently skipped them)

Resources/Instructions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions