@powersync/service-core 0.0.0-dev-20260223080959 → 0.0.0-dev-20260223082111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,48 +0,0 @@
1
- import { BasicRouterRequest, Context, JwtPayload } from '@/index.js';
2
- import { logger } from '@powersync/lib-services-framework';
3
- import { describe, expect, it } from 'vitest';
4
- import { validate } from '../../../src/routes/endpoints/admin.js';
5
- import { mockServiceContext } from './mocks.js';
6
-
7
- describe('admin routes', () => {
8
- describe('validate', () => {
9
- it('reports errors with source location', async () => {
10
- const context: Context = {
11
- logger: logger,
12
- service_context: mockServiceContext(null),
13
- token_payload: new JwtPayload({
14
- sub: '',
15
- exp: 0,
16
- iat: 0
17
- })
18
- };
19
-
20
- const request: BasicRouterRequest = {
21
- headers: {},
22
- hostname: '',
23
- protocol: 'http'
24
- };
25
-
26
- const response = await validate.handler({
27
- context,
28
- params: {
29
- sync_rules: `
30
- bucket_definitions:
31
- missing_table:
32
- data:
33
- - SELECT * FROM missing_table
34
- `
35
- },
36
- request
37
- });
38
-
39
- expect(response.errors).toEqual([
40
- expect.objectContaining({
41
- level: 'warning',
42
- location: { start_offset: 70, end_offset: 83 },
43
- message: 'Table public.missing_table not found'
44
- })
45
- ]);
46
- });
47
- });
48
- });