Skip to content

Commit 6a7da2c

Browse files
update report.json format
1 parent 7912f47 commit 6a7da2c

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

testing/report/src/index.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ async function report() {
161161
},
162162
});
163163

164-
const image_b = path.join(coverage_node_path, "b.png");
164+
const image_b_rel = "./b.png";
165+
const image_b = path.join(coverage_node_path, image_b_rel);
165166
await fs.writeFile(image_b, screenshot_buffer);
166167

167168
const exported = exports[frame.id];
168-
const image_a = path.join(coverage_node_path, "a.png");
169+
const image_a_rel = "./a.png";
170+
const image_a = path.join(coverage_node_path, image_a_rel);
169171
// download the exported image with url
170172
// if the exported is local fs path, then use copy instead
171173
if (exists(exported)) {
@@ -191,15 +193,25 @@ async function report() {
191193
// );
192194

193195
const report = {
194-
id: filekey,
196+
community_id: filekey,
197+
filekey: "unknown",
198+
type: "FRAME",
199+
name: frame.name,
200+
id: frame.id,
195201
width,
196202
height,
197-
image_a: image_a,
198-
image_b: image_b,
203+
image_a: image_a_rel,
204+
image_b: image_b_rel,
205+
reported_at: new Date().toISOString(),
199206
diff: {
200207
hitmap: diff_file,
201208
percent: diff.rawMisMatchPercentage,
202209
},
210+
engine: {
211+
name: "@codetest/codegen",
212+
version: "2023.1.1",
213+
framework: "preview",
214+
},
203215
};
204216

205217
// wrie report.json

0 commit comments

Comments
 (0)