How to use the @hint/utils-create-server.Server.create 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
const runHint = async (t: ExecutionContext, hintTest: HintTest, connector: string) => {
        let engine,
            server;

        try {
            server = await Server.create({ configuration: hintTest.serverConfig, isHTTPS: configs.https });

            const { serverUrl, reports } = hintTest;
            const target = serverUrl ? serverUrl : `${configs.https ? 'https' : 'http'}://localhost:${server.port}/`;

            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);

@hint/utils-create-server

hint create server util

Apache-2.0
Latest version published 11 months ago

Package Health Score

77 / 100
Full package analysis