Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);