-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Copy link
Labels
status:needs-more-infoThere's not enough information to start working on this issueThere's not enough information to start working on this issuestatus:needs-priorityPrioritisation is not completePrioritisation is not complete
Description
Describe the feature
When running tests, Solidity console.log() statements produce output regardless of test outcome. This clutters the terminal during successful test runs when debug output isn't needed.
Motivation:
I want to see console.log() output only when tests fail, keeping successful runs clean. Currently there's no way to conditionally control this from test runners or programmatically.
Proposed solution:
Expose the logger config option for EDR networks, allowing users to provide custom printLineFn/replaceLastLineFn handlers. This enables test frameworks to buffer or suppress output based on test results.
networks: {
hardhat: {
type: "edr-simulated",
logger: {
enabled: false,
printLineFn: (line) => { /* custom handling */ },
replaceLastLineFn: (line) => { /* custom handling */ },
},
},
}
Use case:
Test runners can buffer log output and only display it when a test fails, similar to how many test frameworks handle stdout.
Search terms
hide console.log in tests
Metadata
Metadata
Assignees
Labels
status:needs-more-infoThere's not enough information to start working on this issueThere's not enough information to start working on this issuestatus:needs-priorityPrioritisation is not completePrioritisation is not complete
Type
Projects
Status
Backlog