fix: always throw errors & always use named Error classes #1360
ts_test.yml
on: pull_request
List packages
7s
List examples
4s
Matrix: Build and test
Matrix: check_packages
Matrix: check_and_build_examples
Annotations
18 errors
Check packages/typescript-client:
packages/typescript-client/src/client.ts#L18
'ShapeStreamAlreadyRunningError' is defined but never used. Allowed unused vars must match /^_/u
|
Check packages/typescript-client:
packages/typescript-client/src/client.ts#L71
'RetryOpts' is defined but never used. Allowed unused vars must match /^_/u
|
Check packages/typescript-client
Process completed with exit code 1.
|
Unhandled error:
packages/typescript-client/src/error.ts#L42
FetchError: HTTP Error 400 at http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.440f96c0ab806%22&where=1%3D1&offset=-1&handle=16097754-1732040325582: {"message":"The specified shape definition and handle do not match. Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one."}
❯ Function.fromResponse src/error.ts:42:12
❯ processTicksAndRejections node:internal/process/task_queues:95:5
❯ src/fetch.ts:67:20
❯ prefetchClient src/fetch.ts:136:22
❯ ShapeStream.<anonymous> src/fetch.ts:166:22
❯ ShapeStream.#start src/client.ts:369:22
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { url: 'http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.440f96c0ab806%22&where=1%3D1&offset=-1&handle=16097754-1732040325582', status: 400, text: undefined, json: { message: 'The specified shape definition and handle do not match. Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one.' }, headers: { 'access-control-allow-methods': 'GET, HEAD, DELETE, OPTIONS', 'access-control-allow-origin': '*', 'access-control-expose-headers': '*', 'cache-control': 'max-age=0, private, must-revalidate', 'content-encoding': 'gzip', 'content-length': '140', 'content-type': 'application/json; charset=utf-8', date: 'Tue, 19 Nov 2024 18:18:44 GMT', server: 'ElectricSQL/0.8.2', vary: 'accept-encoding', 'x-request-id': 'GAlxf9fJRRb6w48AAApi' } }
This error originated in "test/integration.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should handle invalid requests by terminating stream". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.
|
Unhandled error:
packages/typescript-client/src/parser.ts#L102
SyntaxError: Unexpected end of JSON input
❯ MessageParser.parse src/parser.ts:102:17
❯ ShapeStream.#start src/client.ts:425:43
❯ processTicksAndRejections node:internal/process/task_queues:95:5
This error originated in "test/client.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should stop fetching and report an error if response is missing required headers". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.
|
Unhandled error:
packages/typescript-client/src/parser.ts#L102
SyntaxError: Unexpected end of JSON input
❯ MessageParser.parse src/parser.ts:102:17
❯ ShapeStream.#start src/client.ts:425:43
This error originated in "test/client.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should stop fetching and report an error if response is missing required headers". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- If the error occurred after the test had been completed, this was the last documented test before it was thrown.
|
test/client.test.ts > Shape > should throw on a reserved parameter:
packages/typescript-client/test/client.test.ts#L38
Error: Snapshot `Shape > should throw on a reserved parameter 1` mismatched
Expected: "[Error: Cannot use reserved Electric parameter names in custom params: database_id]"
Received: "[ReservedParamError: Cannot use reserved Electric parameter names in custom params: database_id]"
❯ test/client.test.ts:38:8
|
Build and test (packages/typescript-client)
Process completed with exit code 1.
|
test/react-hooks.test.tsx > useShape > should sync a shape:
packages/react-hooks/test/react-hooks.test.tsx#L63
AssertionError: expected [] to deeply equal [ { …(2) } ]
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
- Expected
+ Received
- Array [
- Object {
- "id": "f313dd2b-51c5-45a0-af1f-43928f059f78",
- "title": "test row",
- },
- ]
+ Array []
❯ test/react-hooks.test.tsx:63:35
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should re-sync a shape after an interrupt:
packages/react-hooks/test/react-hooks.test.tsx#L96
AssertionError: expected [] to deeply equal [ { …(2) } ]
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
<div />
</body>
</html>
- Expected
+ Received
- Array [
- Object {
- "id": "34d849f8-6f95-438f-b3d0-9f1b05e0fbf5",
- "title": "test row",
- },
- ]
+ Array []
❯ test/react-hooks.test.tsx:96:35
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should expose isLoading status:
packages/react-hooks/test/react-hooks.test.tsx#L114
AssertionError: expected true to be false // Object.is equality
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
- Expected
+ Received
- false
+ true
❯ test/react-hooks.test.tsx:114:58
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should expose time at which we last synced:
packages/react-hooks/test/react-hooks.test.tsx#L136
AssertionError: expected undefined to be defined
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
❯ test/react-hooks.test.tsx:136:61
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should keep the state value in sync:
packages/react-hooks/test/react-hooks.test.tsx#L157
AssertionError: expected [] to not deeply equal []
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
Compared values have no visual difference.
❯ test/react-hooks.test.tsx:157:57
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should let you change the shape definition (and clear the internal cache between):
packages/react-hooks/test/react-hooks.test.tsx#L192
AssertionError: expected [] to deeply equal [ { …(2) } ]
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
- Expected
+ Received
- Array [
- Object {
- "id": "61438901-4b18-4b77-8632-cb516b80e093",
- "title": "test row",
- },
- ]
+ Array []
❯ test/react-hooks.test.tsx:192:35
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should allow use of the "selector" api from useSyncExternalStoreWithSelector:
packages/react-hooks/test/react-hooks.test.tsx#L230
AssertionError: expected [] to deeply equal [ { …(2) } ]
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
- Expected
+ Received
- Array [
- Object {
- "id": "a5fa1bec-ae7a-4c9c-b261-e9c3caf4e02a",
- "title": "test row",
- },
- ]
+ Array []
❯ test/react-hooks.test.tsx:230:35
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should correctly reapply the selector to the data if it changes:
packages/react-hooks/test/react-hooks.test.tsx#L275
AssertionError: expected [] to deeply equal [ { …(2) } ]
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
- Expected
+ Received
- Array [
- Object {
- "id": "a6a47839-719a-4164-91bd-bdfa419e5300",
- "title": "test row 2",
- },
- ]
+ Array []
❯ test/react-hooks.test.tsx:275:35
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
test/react-hooks.test.tsx > useShape > should unmount cleanly:
packages/react-hooks/test/react-hooks.test.tsx#L301
AssertionError: expected [] to not deeply equal []
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div />
</body>
</html>
Compared values have no visual difference.
❯ test/react-hooks.test.tsx:301:57
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Build and test (packages/react-hooks)
Process completed with exit code 1.
|