@hedia/test
Advanced tools
Comparing version 1.1.1 to 1.2.1
{ | ||
"name": "@hedia/test", | ||
"version": "1.1.1", | ||
"version": "1.2.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,5 +0,6 @@ | ||
import { writeFileSync } from "fs"; | ||
import { readFileSync } from "fs"; | ||
export default async function* testReporter(source) { | ||
try { | ||
const events = []; | ||
let title = '' | ||
const tests = []; | ||
@@ -10,4 +11,2 @@ let nestedTitles = []; | ||
for await (const event of source) { | ||
events.push(event); | ||
switch (event.type) { | ||
@@ -60,6 +59,9 @@ case "test:start": | ||
break; | ||
case "test:coverage": | ||
const location = event.data.summary.workingDirectory + "/package.json" | ||
const { name, version } = JSON.parse(readFileSync(location, 'utf8')) | ||
title = `${name}@${version}` | ||
} | ||
} | ||
// const input = "http://localhost:8469/api/v1/reports"; | ||
const input = "https://test.hedia.dev/api/v1/reports"; | ||
@@ -73,3 +75,3 @@ const init = { | ||
{ | ||
title: new Date().toISOString(), | ||
title, | ||
tests, | ||
@@ -86,4 +88,2 @@ }, | ||
yield true; | ||
writeFileSync("./test-report.json", JSON.stringify(events, null, 4), "utf-8"); | ||
} catch (err) { | ||
@@ -90,0 +90,0 @@ console.error(err.message); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2633
78