greenbump 0.2.0 → 0.2.1

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.
@@ -1,56 +0,0 @@
1
- import { test } from "node:test";
2
- import assert from "node:assert/strict";
3
- import { readFile } from "node:fs/promises";
4
- import { join } from "node:path";
5
- import { buildReport, writeReport, REPORT_SCHEMA_VERSION } from "./report.js";
6
- import { withTmpDir } from "./test-utils.js";
7
- function summary(overrides = {}) {
8
- return {
9
- dep: "lodash",
10
- from: "4.17.20",
11
- to: "4.17.21",
12
- packageManager: "npm",
13
- baselineGreen: true,
14
- neededFix: false,
15
- fixed: true,
16
- unverifiable: false,
17
- needsReview: false,
18
- committed: true,
19
- rounds: 0,
20
- usage: { inputTokens: 0, outputTokens: 0 },
21
- editedFiles: [],
22
- testFilesTouched: [],
23
- durationMs: 0,
24
- ...overrides,
25
- };
26
- }
27
- test("buildReport: wraps a single run in the same array envelope as a batch", () => {
28
- const envelope = buildReport([summary()]);
29
- assert.equal(envelope.schemaVersion, REPORT_SCHEMA_VERSION);
30
- assert.ok(Array.isArray(envelope.runs));
31
- assert.equal(envelope.runs.length, 1);
32
- assert.ok(typeof envelope.generatedAt === "string" && !Number.isNaN(Date.parse(envelope.generatedAt)));
33
- });
34
- test("buildReport: batch of results, mixing successes and failures, keeps the array shape", () => {
35
- const failure = { dep: "axios", error: "install failed", fatal: true };
36
- const envelope = buildReport([summary({ dep: "lodash" }), failure]);
37
- assert.equal(envelope.runs.length, 2);
38
- });
39
- test("writeReport: round-trips through disk with schema and fields intact", async () => {
40
- await withTmpDir(async (dir) => {
41
- const failure = { dep: "axios", error: "install failed", fatal: true };
42
- const envelope = buildReport([summary({ dep: "lodash", rounds: 3 }), failure]);
43
- const path = join(dir, "report.json");
44
- await writeReport(path, envelope);
45
- const raw = await readFile(path, "utf8");
46
- const parsed = JSON.parse(raw);
47
- assert.equal(parsed.schemaVersion, 1);
48
- assert.equal(parsed.runs.length, 2);
49
- assert.equal(parsed.runs[0].dep, "lodash");
50
- assert.equal(parsed.runs[0].rounds, 3);
51
- assert.equal(parsed.runs[1].dep, "axios");
52
- assert.equal(parsed.runs[1].error, "install failed");
53
- assert.equal(parsed.runs[1].fatal, true);
54
- });
55
- });
56
- //# sourceMappingURL=report.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"report.test.js","sourceRoot":"","sources":["../src/report.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,SAAS,OAAO,CAAC,YAAiC,EAAE;IAClD,OAAO;QACL,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,SAAS;QACb,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,KAAK;QACnB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QAC1C,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,EAAE;QACpB,UAAU,EAAE,CAAC;QACb,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,IAAI,CAAC,uEAAuE,EAAE,GAAG,EAAE;IACjF,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,CAAC,QAA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