| ... | ... | @@ -23,6 +23,19 @@ it("creates stable keys regardless of environment order", () => { |
| 23 | 23 | ); |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | it("creates keys without array methods unavailable in Hermes", () => { |
| 27 | const descriptor = Object.getOwnPropertyDescriptor(Array.prototype, "toSorted"); |
| 28 | Reflect.deleteProperty(Array.prototype, "toSorted"); |
| 29 | |
| 30 | try { |
| 31 | expect(makeThreadSearchKey([envB, envA], "needle")).toBe('[["env-a","env-b"],"needle"]'); |
| 32 | } finally { |
| 33 | if (descriptor !== undefined) { |
| 34 | Reflect.defineProperty(Array.prototype, "toSorted", descriptor); |
| 35 | } |
| 36 | } |
| 37 | }); |
| 38 | |
| 26 | 39 | it("encodes scoped thread keys without delimiter collisions", () => { |
| 27 | 40 | const first = threadSearchMatchKey({ |
| 28 | 41 | environmentId: EnvironmentId.make("env\u0000thread"), |