Skip to content

Commit b0c3356

Browse files
committed
fix: update tests
1 parent d617992 commit b0c3356

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

test/index.test.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
import { createSchema, createTableSchema, Zero } from '@rocicorp/zero'
1+
import { createSchema, string, table, Zero } from '@rocicorp/zero'
22
import { describe, expect, it } from 'vitest'
33

44
import { useQuery } from '../src/index'
55

66
describe('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

0 commit comments

Comments
 (0)