zenstack/tests/regression/test/issue-558.test.ts
FTB_lag 3fde86d9cf
feat(cli): implement watch mode for generate (#554)
* feat(cli): implement watch mode for generate

* chore(root): update pnpm-lock.yaml

* chore(cli): track all model declaration and removed paths, logs in past tense

* fix(cli): typo, unused double array from

* fix(orm): preserve zod validation errors when validating custom json types

* update

* chore(cli): move import, fix parallel generation on watch

* feat(common-helpers): implement single-debounce

* chore(cli): use single-debounce for debouncing

* feat(common-helpers): implement single-debounce

* fix(common-helpers): re run single-debounce

---------

Co-authored-by: Yiming Cao <yiming@whimslab.io>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-01-07 21:52:50 +08:00

19 lines
461 B
TypeScript

import { createTestClient } from '@zenstackhq/testtools';
import { describe, expect, it } from 'vitest';
describe('Regression for issue #558', () => {
it('verifies issue 558', async () => {
const db = await createTestClient(`
type Foo {
x Int
}
model Model {
id String @id @default(cuid())
foo Foo @json
}
`);
await expect(db.model.create({ data: { foo: { x: 'hello' } } })).rejects.toThrow('data.foo.x');
});
});