async function requestTestPage(browser, webRootDir, scriptSrcs, callback) {
    var scripts = '';
    for (let scriptSrc of scriptSrcs) {
        scripts += `<script src="${scriptSrc}"></script>`;
    }

    const testHtml = `<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <div id="app"></div>
    ${scripts}
</body>
</html>
`;

    // write the testing.html file
    fs.writeFileSync(
        path.join(webRootDir, 'testing.html'),
        testHtml
    );

    // start the main local server
    startHttpServer('8080', webRootDir);
    // start a secondary server - can be used as the "CDN"
    startHttpServer('8090', webRootDir);

    const loadedResources = [];

    const context = await browser.createBrowserContext();
    const page = await context.newPage();

    page.on('error', (error) => {
        throw new Error(`Error when running the browser: "${error.message}".`, { cause: error });
    });

    page.on('requestfailed', (request) => {
        throw new Error(`Error "${request.failure().errorText}" when requesting resource "${request.url()}".`);
    });

    page.on('response', (response) => {
        loadedResources.push({
            response,
        });
    });

    await page.goto('http://127.0.0.1:8080/testing.html', {
        waitUntil: 'networkidle0',
    });
    stopAllServers();
    await callback({ page, loadedResources });
    await page.close();
}
Creates a testing.html file with specified script and link tags,
makes a request to it, and executes a callback, passing that
the Browser instance used to make the request.

@param {import('puppeteer').Browser} browser Puppeteer browser instance
@param {string} webRootDir Directory path (e.g. /path/to/public) where the web server should be rooted
@param {Array} scriptSrcs  Used to create <script src=""> tags.
@param {function({
     page: import('puppeteer').Page,
     loadedResources: Array<{ response: import('puppeteer').HTTPResponse }>}
): void} callback Called after the page was requested.
@returns {Promise<void>}