1- import { describe , expect , it , vi } from 'vitest'
1+ import { describe , expect , it } from 'vitest'
22
33import { Model , useRepo } from '../../../src'
44import { 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