Skip to content

Commit 40cf182

Browse files
committed
test(pinia-orm): add skipped test with throw error
1 parent 6b1c22e commit 40cf182

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/pinia-orm/tests/feature/repository/retrieves_has.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, it, vi } from 'vitest'
1+
import { describe, expect, it } from 'vitest'
22

33
import { Model, useRepo } from '../../../src'
44
import { Attr, HasMany, HasOne, Num, Str } from '../../../src/decorators'
@@ -212,11 +212,9 @@ describe('feature/repository/retrieves_has', () => {
212212
assertModels(users, expected)
213213
})
214214

215-
it.skip('can throw an error if a wrong relation is queried', () => {
215+
it('can throw an error if a wrong relation is queried', () => {
216216
const userRepo = useRepo(User)
217217

218-
const hasMeethod = vi.spyOn(userRepo, 'has')
219-
220218
fillState({
221219
users: {
222220
1: { id: 1, name: 'John Doe' },
@@ -230,8 +228,8 @@ describe('feature/repository/retrieves_has', () => {
230228
},
231229
})
232230

233-
userRepo.has('postss', '<', 2).get()
234-
235-
expect(hasMeethod).toThrowError('[Pinia ORM] Relationship [postss] on model [users] not found.')
231+
expect(() => {
232+
userRepo.has('postss', '<', 2).get()
233+
}).toThrowError('[Pinia ORM] Relationship [postss] on model [users] not found.')
236234
})
237235
})

0 commit comments

Comments
 (0)