@syncmatters/connector-sdk 1.0.46 → 1.0.47
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.
- package/docs/09-testing.md +20 -1
- package/package.json +3 -3
package/docs/09-testing.md
CHANGED
|
@@ -204,6 +204,24 @@ const idsFilterData = {
|
|
|
204
204
|
};
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
+
**`noRows: true`** says the query must succeed and return nothing: an unknown id that reads as
|
|
208
|
+
"not found" rather than an error, a filter or match that finds nothing, a parent without
|
|
209
|
+
children, a checkpoint with nothing newer. Row filters, match rules, related filters and
|
|
210
|
+
checkpoint step 2 honour it. Without it an empty expected id list is still rejected as invalid
|
|
211
|
+
test data, so a prepare hook that found nothing by accident cannot pass; with it the list must
|
|
212
|
+
be empty.
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
/** @type {SDKTest.RowFilterData} */
|
|
216
|
+
const unknownId = { rowFilter: { id: "999999999" }, expectedRowIds: [], expect: { noRows: true } };
|
|
217
|
+
|
|
218
|
+
/** @type {SDKTest.CheckpointStep2Data} - a quiet sandbox: nothing changed since the emitted checkpoint */
|
|
219
|
+
const step2 = { expectedRowIds: [], expect: { noRows: true } };
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Do not set `noRows` because a prepare hook's own query came back empty: state it only where the
|
|
223
|
+
suite knows the answer is "nothing" (an id it made up, a row it did not change).
|
|
224
|
+
|
|
207
225
|
**`rows`** maps a row's `meta.key` (or `"*"` for every row) to assertions on `row.data` by path.
|
|
208
226
|
Each assertion is one of:
|
|
209
227
|
|
|
@@ -539,7 +557,8 @@ Requirements that only surface as cryptic failures when unmet:
|
|
|
539
557
|
normalizes or formats. And return the SAME `verifyFields` paths from both prepare calls:
|
|
540
558
|
the harness reads row 2's values through call 1's paths.
|
|
541
559
|
- **relatedFilterPrepare needs a declaring-object row that actually has related rows** —
|
|
542
|
-
`expectedRelatedRowIds` must be non-empty
|
|
560
|
+
`expectedRelatedRowIds` must be non-empty (a case that proves "this parent has no children"
|
|
561
|
+
says so with `expect: { noRows: true }`). In the parent-owns-children shape that means a
|
|
543
562
|
parent with at least one child in the sandbox (create one in `before()` when the API allows;
|
|
544
563
|
otherwise seed the sandbox account once and document it in the test file).
|
|
545
564
|
- **Checkpoint step 2 does not have to create data** — see
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncmatters/connector-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "TypeScript type definitions for the SyncMatters connector SDK (types only - connectors execute on the SyncMatters platform)",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": "SyncMatters",
|
|
14
14
|
"homepage": "https://syncmatters.com",
|
|
15
|
-
"typesContentHash": "
|
|
15
|
+
"typesContentHash": "ccbb10eddc34a239ade45eb32a0dd950c73bb934006dd3c4e899a9199f579434",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/node": "*",
|
|
18
|
-
"@syncmatters/script-api": "^1.0.
|
|
18
|
+
"@syncmatters/script-api": "^1.0.49"
|
|
19
19
|
}
|
|
20
20
|
}
|