mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add memory debugging to mocha runner (#11722)
This commit is contained in:
@@ -46,6 +46,7 @@ const {
|
||||
minTests,
|
||||
shard,
|
||||
reporter,
|
||||
printMemory,
|
||||
} = yargs(hideBin(process.argv))
|
||||
.parserConfiguration({'unknown-options-as-args': true})
|
||||
.scriptName('@puppeteer/mocha-runner')
|
||||
@@ -82,6 +83,10 @@ const {
|
||||
string: true,
|
||||
requiresArg: true,
|
||||
})
|
||||
.option('print-memory', {
|
||||
boolean: true,
|
||||
default: false,
|
||||
})
|
||||
.parseSync();
|
||||
|
||||
function getApplicableTestSuites(
|
||||
@@ -197,6 +202,10 @@ async function main() {
|
||||
'trace-warnings',
|
||||
];
|
||||
|
||||
if (printMemory) {
|
||||
args.push('-n', 'expose-gc');
|
||||
}
|
||||
|
||||
const specPattern = 'test/build/**/*.spec.js';
|
||||
const specs = globSync(specPattern, {
|
||||
ignore: !includeCdpTests ? 'test/build/cdp/**/*.spec.js' : undefined,
|
||||
|
||||
Reference in New Issue
Block a user