How to use the @hint/utils-create-server.Server.updateLocalhost function in @hint/utils-create-server

To help you get started, we’ve selected a few @hint/utils-create-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / utils-tests-helpers / src / hint-runner.ts View on Github external
engine = await createConnector(t, hintTest, connector);
            const results = await engine.executeOn(new URL(target));

            const sources = new Map();

            for (const result of results) {
                if (!sources.has(result.resource)) {
                    sources.set(result.resource, await requestSource(result.resource, connector));
                }
            }

            await stopConnector(hintTest, engine);
            await server.stop();

            return validateResults(t, sources, results, Server.updateLocalhost(reports, server.port));
        } catch (e) {
            console.error(e);

            if (server) {
                await server.stop();
            }

            if (engine) {
                await engine.close();
            }

            return t.fail(`${hintTest.name} throwed an exception:\n${e.message}\n${e.stack}`);
        }
    };

@hint/utils-create-server

hint create server util

Apache-2.0
Latest version published 4 months ago

Package Health Score

84 / 100
Full package analysis