Skip to content

Commit

Permalink
[#31] type updates to allow optional config (#32)
Browse files Browse the repository at this point in the history
* fix: type updates to allow optional config

* chore: disable chrome web security while testing on 3rd party sites
  • Loading branch information
jlp-craigmorten authored Dec 14, 2023
1 parent 4eaa29c commit 07afc6f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,26 @@ declare namespace Cypress {
* Runs a Web Vitals audit
* @example
* cy.vitals({ thresholds, url, selector });
* @param {WebVitalsConfig} webVitalsConfig configuration
* @param {WebVitalsConfig} [webVitalsConfig] configuration
*/
vitals(webVitalsConfig?: WebVitalsConfig);

/**
* Starts a Web Vitals audit. Use with `cy.reportVitals()`.
* @example
* cy.startVitalsCapture({ url });
* @param {StartWebVitalsCaptureConfig} startWebVitalsCaptureConfig configuration
* @param {StartWebVitalsCaptureConfig} [startWebVitalsCaptureConfig] configuration
*/
startVitalsCapture(
startWebVitalsCaptureConfig: StartWebVitalsCaptureConfig
startWebVitalsCaptureConfig?: StartWebVitalsCaptureConfig
);

/**
* Reports on a Web Vitals audit. Use with `cy.startVitalsCapture()`.
* @example
* cy.reportVitals({ thresholds });
* @param {ReportWebVitalsConfig} reportWebVitalsConfig configuration
* @param {ReportWebVitalsConfig} [reportWebVitalsConfig] configuration
*/
reportVitals(reportWebVitalsConfig: ReportWebVitalsConfig);
reportVitals(reportWebVitalsConfig?: ReportWebVitalsConfig);
}
}
1 change: 1 addition & 0 deletions examples/10.x/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { defineConfig } = require("cypress");
module.exports = defineConfig({
video: false,
screenshotOnRunFailure: false,
chromeWebSecurity: false,
e2e: {
setupNodeEvents(_on, _config) {},
},
Expand Down
1 change: 1 addition & 0 deletions examples/12.x/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { defineConfig } = require("cypress");
module.exports = defineConfig({
video: false,
screenshotOnRunFailure: false,
chromeWebSecurity: false,
e2e: {
setupNodeEvents(_on, _config) {},
},
Expand Down
2 changes: 2 additions & 0 deletions examples/13.x/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
video: false,
screenshotOnRunFailure: false,
chromeWebSecurity: false,
e2e: {
setupNodeEvents(_on, _config) {},
},
Expand Down
3 changes: 2 additions & 1 deletion examples/9.x/cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"video": false,
"screenshotOnRunFailure": false
"screenshotOnRunFailure": false,
"chromeWebSecurity": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-web-vitals",
"version": "4.1.0",
"version": "4.1.1",
"description": "A Web Vitals command for cypress",
"author": "Craig Morten <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 07afc6f

Please sign in to comment.