chore: fix logging spec

This commit is contained in:
Danish Arora 2025-01-31 16:31:20 +05:30
parent dd4788ff55
commit 76ec0d5a80
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
3 changed files with 16 additions and 18 deletions

View File

@ -34,32 +34,30 @@ async function main() {
if (process.env.CI) { if (process.env.CI) {
const reportsDir = getPackagePath("reports"); const reportsDir = getPackagePath("reports");
const reportFile = resolve(reportsDir, "mocha-results.json"); const reportFile = resolve(reportsDir, "mocha-results.json");
const configFile = resolve(reportsDir, "config.json");
await mkdir(reportsDir, { recursive: true }); await mkdir(reportsDir, { recursive: true });
// Create a clean reporter config // Use both spec and JSON reporters in CI
mochaArgs.push(
"--reporter",
"mocha-multi-reporters",
"--reporter-options",
`configFile=${getPackagePath("reporter-config.json")}`
);
// Create reporter config file
const reporterConfig = { const reporterConfig = {
reporterEnabled: "spec", reporterEnabled: "spec, json",
reporterOptions: { reporterOptions: {
json: { json: {
stdout: false,
options: {
output: reportFile output: reportFile
} }
} }
}
}; };
// Write the config file await writeFile(
await writeFile(configFile, JSON.stringify(reporterConfig, null, 2)); getPackagePath("reporter-config.json"),
JSON.stringify(reporterConfig, null, 2)
// Add a separate JSON reporter directly
mochaArgs.push(
"--reporter-option",
`output=${reportFile}`,
"--reporter",
"json"
); );
} else { } else {
// In non-CI environments, just use spec reporter // In non-CI environments, just use spec reporter

View File

@ -45,7 +45,7 @@ import {
} from "./utils.js"; } from "./utils.js";
describe("Waku Store, general", function () { describe("Waku Store, general", function () {
this.timeout(15000); this.timeout(120000);
let waku: LightNode; let waku: LightNode;
let waku2: LightNode; let waku2: LightNode;
let nwaku: ServiceNode; let nwaku: ServiceNode;