Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/bot/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
verbose: true,
clearMocks: true,
resetMocks: true,
restoreMocks: true,
// Deliberate: Discord integration tests use shorter timeout than backend (30000)
testTimeout: 15000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ function failedOps(): string[] {

describe('runPostPlayBackgroundOps', () => {
beforeEach(() => {
jest.clearAllMocks()
// Explicitly clear and reset all mock implementations to prevent test pollution
clearAutoplayPause.mockClear()
clearAutoplayPause.mockReturnValue(undefined)
applyStoredAutoplayPreference.mockClear()
applyStoredAutoplayPreference.mockResolvedValue(undefined)
blendAutoplayTracks.mockClear()
blendAutoplayTracks.mockResolvedValue(undefined)
clearSessionMoodCache.mockClear()
clearSessionMoodCache.mockReturnValue(undefined)
addBreadcrumb.mockClear()
errorLog.mockClear()
})

it('runs all three ops on the happy path with no failure breadcrumb', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ describe('consumeLastFmSeedSlice', () => {
)

it('returns empty array when no cache or on error', async () => {
getByDiscordIdMock.mockResolvedValue(null)
const unknownSlice = await consumeLastFmSeedSlice('unknown-user', 3)
expect(unknownSlice).toEqual([])

Expand Down
6 changes: 5 additions & 1 deletion packages/bot/src/utils/music/queueManipulation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,11 @@ describe('queueManipulation — genre candidate collection', () => {

describe('queueManipulation — multi-user VC blend', () => {
beforeEach(() => {
jest.clearAllMocks()
// resetAllMocks (not clearAllMocks) — this block re-establishes defaults
// below assuming a full reset; clearAllMocks leaves queued
// mockResolvedValueOnce() values from the previous test in place, which
// corrupts ordered call sequences (e.g. per-call-site token mocks).
jest.resetAllMocks()
consumeLastFmSeedSliceMock.mockResolvedValue([])
consumeBlendedSeedSliceMock.mockResolvedValue([])
getLastFmLinkMock.mockResolvedValue(null)
Expand Down
5 changes: 5 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
allowBuilds:
'@prisma/engines': set this to true or false
Comment thread
LucasSantana-Dev marked this conversation as resolved.
Resolved
msgpackr-extract: set this to true or false
prisma: set this to true or false
unrs-resolver: set this to true or false
Loading