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

@ -86,6 +86,6 @@
"interface-datastore": "^8.2.10",
"libp2p": "2.1.8",
"mocha": "^10.3.0",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5"
}
}

View File

@ -34,32 +34,30 @@ async function main() {
if (process.env.CI) {
const reportsDir = getPackagePath("reports");
const reportFile = resolve(reportsDir, "mocha-results.json");
const configFile = resolve(reportsDir, "config.json");
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 = {
reporterEnabled: "spec",
reporterEnabled: "spec, json",
reporterOptions: {
json: {
stdout: false,
options: {
output: reportFile
}
output: reportFile
}
}
};
// Write the config file
await writeFile(configFile, JSON.stringify(reporterConfig, null, 2));
// Add a separate JSON reporter directly
mochaArgs.push(
"--reporter-option",
`output=${reportFile}`,
"--reporter",
"json"
await writeFile(
getPackagePath("reporter-config.json"),
JSON.stringify(reporterConfig, null, 2)
);
} else {
// In non-CI environments, just use spec reporter

View File

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