const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
  
    page.on("console", msg => {
        console.log(msg.text());
    });

    await page.exposeFunction("puppeteer_runEnd", async (results) => {
        const tests = results.tests;
        let numAssertions = 0;
        for (let i = 0; i < tests.length; ++i) {
            const test = tests[i];
            const assertions = test.assertions;
            const count = assertions.length;
            numAssertions += count;
            if (test.status === "passed") {
                console.log(`\u001b[32mPass:\u001b[0m ${test.name}`);
            } else {
                for (let j = 0; j < count; ++j) {
                    const assertion = assertions[j];
                    if (!assertion.passed) {
                        console.log(`\n\u001b[31mFail:\u001b[0m ${test.name}: ${assertion.message}\n`);
                        console.log(assertion.stack);
                        console.log("\n");
                    }
                }
            }
        }
        console.log(`\nRan ${results.testCounts.total} tests (${numAssertions} assertions)...\n`);
        if (results.status === "passed") {
            console.log("\u001b[32mAll tests passed!\u001b[0m\n");
        } else {
            console.log(`\t\u001b[31m${results.testCounts.failed} tests failed.\u001b[0m\n\n`);
        }

        await browser.close();

        process.exit(passed ? 0 : 1);
    });

    await page.goto('http://localhost:5000/test/');

})();

@@ -32,16 +32,1124 @@
 eteer');
+%0Aconst http = require(%22http%22);%0Aconst fs = require(%22fs%22);%0Aconst path = require(%22path%22);%0A%0Aconst PATH = 'test/';%0Aconst FILE_PATH = path.resolve('.', PATH);%0Aconst PORT = 7171;%0Aconst MIME_TYPES = %7B%0A    %22.css%22:  %22text/css%22,%0A    %22.html%22: %22text/html%22,%0A    %22.js%22: %22text/javascript%22,%0A    %22.json%22: %22application/json%22%0A%7D;%0A%0Aconst server = http.createServer(function (req, res) %7B%0A    const method = req.method;%0A    const url = req.url; %0A    const requestPath = decodeURI(url.replace(/%5E%5C/+/, %22%22).replace(/%5C?.*$/, %22%22));%0A    const filePath = path.resolve('.', requestPath);%0A    const mimeType = MIME_TYPES%5Bpath.extname(filePath)%5D %7C%7C %22application/octet-stream%22;%0A%0A    fs.stat(filePath, function(err, stat) %7B%0A        if (stat && stat.isDirectory()) %7B%0A          fs.readFile(filePath + %22/index.html%22, function(err, content) %7B%0A            res.setHeader(%22Content-Type%22, %22text/html%22);%0A            res.end(content);%0A          %7D);%0A        %7D else %7B%0A          fs.readFile(filePath, function(err, content) %7B%0A            res.setHeader(%22Content-Type%22, mimeType);%0A            res.end(content);%0A          %7D);%0A        %7D%0A    %7D);%0A%7D).listen(PORT);
 %0A%0A(async
@@ -2555,16 +2555,46 @@
      %7D%0A%0A
+        await server.close();%0A
         
@@ -2684,17 +2684,17 @@
 ge.goto(
-'
+%60
 http://l
@@ -2706,19 +2706,24 @@
 ost:
-5000/test/'
+$%7BPORT%7D/$%7BPATH%7D%60
 );%0A%0A

Build in server