Before creating an issue, make sure to have setup the projects with the 3 steps provided in the README. You can also verify the examples folder and check if there is already an application using a similar setup to yours.
What does not work?
Report not able to be generated. Error being thrown is: "Cannot destructure property 'errors' of 'object null' as it is null," and it quotes line 41 at command-handler inside /src, where it reads: .then(({ errors, results })
How to reproduce?
Setting up a basic, essentially empty test, as follows.
describe("empty test", () => {
const retryOptions = {retries: {runMode: 0, openMode: 0}}
it('runs an empty test', retryOptions, () => {
cy.visit(*any url*)
cy.lighthouse()
})
})
index has what it's supposed to:
on('before:browser:launch', (browser, launchOptions) => {
prepareAudit(launchOptions);
return launchOptions
})
inside of on.task:
lighthouse: lighthouse(), // calling the function is important
pa11y: pa11y(), // calling the function is important
and in commands:
import "cypress-audit/commands";
Expected behavior
Audit will be generated
Environment (please complete the following information):
- OS: Mac OsX 12.01
- Chrome version: 95.0.4638.69
- Cypress version: 8.6
Any other information that may help fixing the issue?
My inclination is that this is perhaps more a problem with cypress and the way it handles port assignment, or maybe another thing I bring up a bit further down, but I'm still creating this issue in case other people are running into the same when trying to incorporate cypress-audit for the first time. Also, this is the console.log of the lighthouse object. Seems relevant that config and opts are both undefined:
{
"config": undefined
"opts": undefined
"url": "*any url*",
"thresholds": {
"performance": 100,
"accessibility": 100,
"best-practices": 100,
"seo": 100,
"pwa": 100
}
}
My last bit of context is that 'before:browser:launch' doesn't seem to be running- console.log-ing it, at least, doesn't show anything. Again, this points to cypress being the problem, but I'm just curious if this has become an issue for anyone else.