File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 1- import { createSchema , createTableSchema , Zero } from '@rocicorp/zero'
1+ import { createSchema , string , table , Zero } from '@rocicorp/zero'
22import { describe , expect , it } from 'vitest'
33
44import { useQuery } from '../src/index'
55
66describe ( 'zero-vue' , ( ) => {
77 it ( 'works' , async ( ) => {
8- const schema = createSchema ( {
9- version : 1 ,
10- tables : {
11- user : createTableSchema ( {
12- tableName : 'user' ,
13- columns : {
14- id : 'string' ,
15- name : 'string' ,
16- } ,
17- primaryKey : 'id' ,
18- } ) ,
19- } ,
8+ const user = table ( 'user' )
9+ . columns ( {
10+ id : string ( ) ,
11+ name : string ( ) ,
12+ } )
13+ . primaryKey ( 'id' )
14+
15+ const schema = createSchema ( 1 , {
16+ tables : [ user ] ,
2017 } )
2118
2219 const z = new Zero ( {
@@ -28,7 +25,7 @@ describe('zero-vue', () => {
2825 kvStore : 'mem' ,
2926 } )
3027
31- const users = useQuery ( z . query . user )
28+ const { data : users } = useQuery ( z . query . user )
3229
3330 expect ( users . value ) . toEqual ( [ ] )
3431
You can’t perform that action at this time.
0 commit comments