@hot-updater/test-utils 1.2.0-rc.33 → 1.2.0-rc.35
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/dist/index.mjs +41 -0
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -680,6 +680,34 @@ const setupCoreAdminTestSuite = (options) => {
|
|
|
680
680
|
expect((await adminJson(`/native-builds/${sandboxBuild.id}`)).data).toEqual(sandboxBuild);
|
|
681
681
|
expect((await adminJson(`/native-builds/${plainBuild.id}`)).data).toEqual(plainBuild);
|
|
682
682
|
expect((await adminJson(`/native-builds/latest?platform=ios&channel=${encodeURIComponent(sandboxChannel)}&fingerprintHash=sandbox-fingerprint`)).data).toEqual(sandboxBuild);
|
|
683
|
+
expect((await adminJson(`/native-builds/latest?platform=ios&channel=${encodeURIComponent(sandboxChannel)}&fingerprintHash=sandbox-fingerprint&builtInOlderThan=ffffffff-ffff-7fff-bfff-ffffffffffff`)).data).toBeNull();
|
|
684
|
+
const patched = await admin(`/bundles/${plainBuild.min_bundle_id}`, jsonRequest("PATCH", { patches: [{
|
|
685
|
+
baseBundleId: sandboxBuild.min_bundle_id,
|
|
686
|
+
baseFileHash: "base-hash",
|
|
687
|
+
byteSize: 42,
|
|
688
|
+
patchFileHash: "patch-hash",
|
|
689
|
+
patchStorageUri: "storage://patches/sandbox.patch"
|
|
690
|
+
}] }));
|
|
691
|
+
expect(patched.status).toBe(400);
|
|
692
|
+
expect(await patched.text()).toContain("A sandbox build's built-in bundle is no patch base.");
|
|
693
|
+
const deployed = await admin("/releases", jsonRequest("POST", { deployments: [{
|
|
694
|
+
bundle: {
|
|
695
|
+
...toDeployBundle(bundleRow("76")),
|
|
696
|
+
patches: [{
|
|
697
|
+
baseBundleId: sandboxBuild.min_bundle_id,
|
|
698
|
+
baseFileHash: "base-hash",
|
|
699
|
+
byteSize: 42,
|
|
700
|
+
patchFileHash: "patch-hash",
|
|
701
|
+
patchStorageUri: "storage://patches/sandbox-deploy.patch"
|
|
702
|
+
}]
|
|
703
|
+
},
|
|
704
|
+
release: policy("sandbox-patch")
|
|
705
|
+
}] }));
|
|
706
|
+
expect(deployed.status).toBe(400);
|
|
707
|
+
expect(await deployed.text()).toContain("A sandbox build's built-in bundle is no patch base.");
|
|
708
|
+
const notDeployed = await admin(`/bundles/${bundleRow("76").id}`);
|
|
709
|
+
expect(notDeployed.status).toBe(404);
|
|
710
|
+
await notDeployed.text();
|
|
683
711
|
const marked = await admin(`/native-builds/${sandboxBuild.id}/store-build`, jsonRequest("POST", { storeBuild: true }));
|
|
684
712
|
expect(marked.status).toBe(400);
|
|
685
713
|
await marked.text();
|
|
@@ -3784,6 +3812,19 @@ const READ_BUDGETS = [
|
|
|
3784
3812
|
},
|
|
3785
3813
|
check: (build) => expect(build).toMatchObject({ min_bundle_id: createBundleFixture("011").id })
|
|
3786
3814
|
}),
|
|
3815
|
+
budget({
|
|
3816
|
+
api: "native build older than a bundle in a sandbox scope: no read",
|
|
3817
|
+
read: ({ core }) => core.findNativeBuild({
|
|
3818
|
+
...nativeBuildScope,
|
|
3819
|
+
channel: "sandbox-release"
|
|
3820
|
+
}, { builtInOlderThan: "ffffffff-ffff-7fff-bfff-ffffffffffff" }),
|
|
3821
|
+
adapter: reads(0, 0, 0, 0),
|
|
3822
|
+
engine: {
|
|
3823
|
+
calls: 0,
|
|
3824
|
+
rows: 0
|
|
3825
|
+
},
|
|
3826
|
+
check: (build) => expect(build).toBeNull()
|
|
3827
|
+
}),
|
|
3787
3828
|
budget({
|
|
3788
3829
|
api: "native build by key: byBuildKey descending, limit 1",
|
|
3789
3830
|
read: ({ core }) => core.findNativeBuild(nativeBuildScope, { buildKey: nativeBuildKey }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/test-utils",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Test utilities for Hot Updater packages",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"mysql2": "*",
|
|
51
51
|
"pg": "*",
|
|
52
52
|
"vitest": "^4.0.0",
|
|
53
|
-
"@hot-updater/plugin-insights": "^1.2.0-rc.
|
|
54
|
-
"@hot-updater/protocol": "^1.2.0-rc.
|
|
55
|
-
"@hot-updater/plugin-core": "^1.2.0-rc.
|
|
56
|
-
"@hot-updater/server": "^1.2.0-rc.
|
|
53
|
+
"@hot-updater/plugin-insights": "^1.2.0-rc.35",
|
|
54
|
+
"@hot-updater/protocol": "^1.2.0-rc.35",
|
|
55
|
+
"@hot-updater/plugin-core": "^1.2.0-rc.35",
|
|
56
|
+
"@hot-updater/server": "^1.2.0-rc.35"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@electric-sql/pglite": {
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
85
85
|
"vitest": "4.1.4",
|
|
86
86
|
"workspace-tools": "^0.42.3",
|
|
87
|
-
"@hot-updater/
|
|
88
|
-
"@hot-updater/plugin-
|
|
89
|
-
"@hot-updater/
|
|
90
|
-
"@hot-updater/
|
|
87
|
+
"@hot-updater/plugin-insights": "1.2.0-rc.35",
|
|
88
|
+
"@hot-updater/plugin-core": "1.2.0-rc.35",
|
|
89
|
+
"@hot-updater/protocol": "1.2.0-rc.35",
|
|
90
|
+
"@hot-updater/server": "1.2.0-rc.35"
|
|
91
91
|
},
|
|
92
92
|
"inlinedDependencies": {
|
|
93
93
|
"@clack/core": "1.4.3",
|