mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 18:18:06 +08:00
21 lines
708 B
JavaScript
21 lines
708 B
JavaScript
const puppeteer = require('../../lib/utils/puppeteer');
|
|
const wait = require('../../lib/utils/wait');
|
|
|
|
describe('puppeteer', () => {
|
|
it('puppeteer run', async () => {
|
|
const browser = await puppeteer();
|
|
const page = await browser.newPage();
|
|
await page.goto('https://www.google.com', {
|
|
waitUntil: 'domcontentloaded',
|
|
});
|
|
|
|
// eslint-disable-next-line no-undef
|
|
const html = await page.evaluate(() => document.body.innerHTML);
|
|
expect(html.length).toBeGreaterThan(0);
|
|
|
|
expect((await browser.process()).exitCode).toBe(null);
|
|
await wait(31 * 1000);
|
|
expect((await browser.process()).exitCode).toBe(0);
|
|
}, 40000);
|
|
});
|