Logging 笑话-如何禁用木偶5日志?
从Puppeter v5开始,我的jest测试会在控制台中充斥Puppeter调试消息,例如。Logging 笑话-如何禁用木偶5日志?,logging,jestjs,puppeteer,Logging,Jestjs,Puppeteer,从Puppeter v5开始,我的jest测试会在控制台中充斥Puppeter调试消息,例如。 木偶演员:协议:RECV◀: {“method”:“Network.loadingFinished”,“params”:{“requestId”:“xxxxxx.xx”,“timestamp”:xxxxxx.xxxxxx,“encodedDataLength”:xxxx,“shouldReportCorbBlocking”:false},“sessionId:“xxxxxxxxxxxxxxxxxxxx
木偶演员:协议:RECV◀: {“method”:“Network.loadingFinished”,“params”:{“requestId”:“xxxxxx.xx”,“timestamp”:xxxxxx.xxxxxx,“encodedDataLength”:xxxx,“shouldReportCorbBlocking”:false},“sessionId:“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”}
test.spec.js:
const puppeteer = require("puppeteer");
describe('puppeteer-test', () => {
it('works', async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://en.wikipedia.org/wiki/Puppeteer");
await browser.close();
});
});
package.json:
{
"dependencies": {
"puppeteer": "5.0.0",
"jest": "26.1.0"
}
}
要执行:node\u modules/.bin/jest
如何关闭这些消息?在Github上观看此问题