Is there a way to run in scripting mode using silent?
Closed this issue · 4 comments
DaveMBush commented
The CLI has a --silent option.
when running using script mode:
const { leaks, runResult } = await run({
scenario,
skipWarmup,
workDir,
});
Is there a way to do the same?
I've tried
process.argv.push('--silent');
But it had no effect.
JacksonGL commented
Consider using the following code to run in silent mode.
const {config} = require('@memlab/core');
config.muteConsole = true;
We can also add an additional option for the run
API.
DaveMBush commented
I just tried the above and I'm still seeing console output.
JacksonGL commented
@DaveMBush can you share the code you use?
For example running node test.js
shows no output on my machine:
// save as test.js
const {run} = require('@memlab/api');
const {config} = require('@memlab/core');
config.muteConsole = true;
(async function () {
const scenario = {
url: () => 'https://www.facebook.com',
};
const {leaks} = await run({scenario});
})();
test.js
is located inside a npm project where it has run npm i memlab
.
DaveMBush commented
Thanks. I found it. I was using config.isContinuousTest = true;
as well and that seems to override config.muteConsole
Thanks again for your help.