Мне нужно передать аргумент connection
при вызове lighthouse
https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/index.js#L41
async function lighthouse(url, flags = {}, configJSON, connection) {
// verify the url is valid and that protocol is allowed
if (url && (!URL.isValid(url) || !URL.isProtocolAllowed(url))) {
throw new LHError(LHError.errors.INVALID_URL);
}
// set logging preferences, assume quiet
flags.logLevel = flags.logLevel || 'error';
log.setLevel(flags.logLevel);
const config = generateConfig(configJSON, flags);
connection = connection || new ChromeProtocol(flags.port, flags.hostname);
// kick off a lighthouse run
return Runner.run(connection, {url, config});
}
И в моем тест-кафе мои тесты выглядят так
test('Run lighthouse, async t => {
lighthouse('https://www.youtube.com', {}, {}, ????)
})
Я не могу получить connection
экземпляра chrome, который открыл testcafe, вместо создания нового chromeRunner