Skip to content

Commit d2319af

Browse files
committed
chore: improve testing
1 parent 7112a4c commit d2319af

17 files changed

Lines changed: 918 additions & 1264 deletions

SIZING_QUICK_REFERENCE.md

Lines changed: 0 additions & 291 deletions
This file was deleted.

src/test/setup.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
import '@testing-library/jest-dom'
22
import { cleanup } from '@testing-library/svelte'
3-
import { afterEach } from 'vitest'
3+
import { afterEach, beforeAll } from 'vitest'
4+
5+
// Suppress jsdom navigation warnings
6+
// jsdom doesn't support window.open or target="_blank" navigation
7+
const originalConsoleError = console.error
8+
beforeAll(() => {
9+
console.error = (...args) => {
10+
const message = args[0]
11+
if (
12+
typeof message === 'string' &&
13+
(message.includes('Not implemented: navigation') ||
14+
message.includes('Not implemented: HTMLFormElement'))
15+
) {
16+
return // Suppress expected jsdom limitations
17+
}
18+
originalConsoleError.apply(console, args)
19+
}
20+
})
421

522
afterEach(() => {
623
cleanup()

tests/unit/application/GetPracticeTreeService.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ describe('GetPracticeTreeService', () => {
195195
})
196196

197197
it('returns error for non-existent practice', async () => {
198+
// Suppress expected error from practice not found
199+
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
200+
198201
const mockRepository = {
199202
getPracticeTree: vi.fn().mockResolvedValue(null)
200203
}
@@ -204,6 +207,8 @@ describe('GetPracticeTreeService', () => {
204207

205208
expect(result.success).toBe(false)
206209
expect(result.error).toBeDefined()
210+
211+
errorSpy.mockRestore()
207212
})
208213

209214
it('preserves quickStartGuide alongside maturityLevel', async () => {

0 commit comments

Comments
 (0)