(benchmark, chrome)
| 15 | } |
| 16 | |
| 17 | async function runScenario(benchmark, chrome) { |
| 18 | const port = chrome.port; |
| 19 | const results = await Lighthouse( |
| 20 | `http://localhost:8080/${benchmark}/`, |
| 21 | { |
| 22 | output: 'json', |
| 23 | port, |
| 24 | }, |
| 25 | config |
| 26 | ); |
| 27 | |
| 28 | const perfMarkings = results.lhr.audits['user-timings'].details.items; |
| 29 | const entries = perfMarkings |
| 30 | .filter(({timingType}) => timingType !== 'Mark') |
| 31 | .map(({duration, name}) => ({ |
| 32 | entry: name, |
| 33 | time: duration, |
| 34 | })); |
| 35 | entries.push({ |
| 36 | entry: 'First Meaningful Paint', |
| 37 | time: results.lhr.audits['first-meaningful-paint'].rawValue, |
| 38 | }); |
| 39 | |
| 40 | return entries; |
| 41 | } |
| 42 | |
| 43 | function bootstrap(data) { |
| 44 | const len = data.length; |
no test coverage detected