increase test coverage

extend test coverage
This commit is contained in:
JFH
2025-12-01 01:22:26 +01:00
parent a37fbac749
commit fa380402e1
52 changed files with 3813 additions and 169 deletions

View File

@@ -9,7 +9,10 @@ describe('draw.Drawing', function () {
const addOwnSpies = (obj) => {
const methods = Object.keys(obj)
methods.forEach((method) => {
vi.spyOn(obj, method)
const spy = vi.spyOn(obj, method)
spy.getCall = (idx = 0) => ({ args: spy.mock.calls[idx] || [] })
Object.defineProperty(spy, 'calledOnce', { get: () => spy.mock.calls.length === 1 })
Object.defineProperty(spy, 'callCount', { get: () => spy.mock.calls.length })
})
}