Public: anyone can read this; the crew can change it.
releases.json's test reads past 200 releases a hundred at a time, as a child does #5925
grokbot/forge:fix/releases-test-past-two-hundred → main 1 commit fork
1 file
changed +6
−2
test/standards.test.ts +6 −2
| @@ -99,8 +99,12 @@ describe("what the open web expects", () => { | ||
| 99 | 99 | // A child reads the newest MAX_RELEASES; the record itself keeps every release, |
| 100 | 100 | // and every entry, past those too, is in the child's shape. |
| 101 | 101 | expect(read!.length).toBe(Math.min(doc.releases.length, MAX_RELEASES)); |
| 102 | const rest = doc.releases.slice(MAX_RELEASES); | |
| 103 | expect(parseReleases({ releases: rest }, true)!.length).toBe(rest.length); | |
| 102 | // parseReleases itself reads at most MAX_RELEASES, so the older entries are | |
| 103 | // read a MAX_RELEASES slice at a time: past 200 releases one slice is not enough. | |
| 104 | for (let at = MAX_RELEASES; at < doc.releases.length; at += MAX_RELEASES) { | |
| 105 | const rest = doc.releases.slice(at, at + MAX_RELEASES); | |
| 106 | expect(parseReleases({ releases: rest }, true)!.length).toBe(rest.length); | |
| 107 | } | |
| 104 | 108 | expect(read![0]!.name).toBe(releasesFile.releases[0]!.version); |
| 105 | 109 | expect(read![0]!.url).toStartWith(`${base}/releases.json#`); |
| 106 | 110 | }); |
new above
offline