chromaui / chromatic-e2e

Archive end-to-end tests to be replayed in Storybook and Chromatic
MIT License
21 stars 4 forks source link

Typescript support for `cy.takeSnapshot` is missing in index.d.ts #136

Closed cellog closed 4 months ago

cellog commented 4 months ago

Describe the bug No typescript support is added for the cy.takeSnapshot command

To Reproduce Try to use cy.takeSnapshot() in a typescript Cypress test

Expected behavior Typescript knows about the takeSnapshot command added

declare global {
  namespace Cypress {
    interface Chainable<Subject = any> {
      takeSnapshot(name?: string): Chainable<void>;
    }
  }
}

needs to be in the index.d.ts that is in dist/

skitterm commented 4 months ago

@cellog thanks for letting us know. We've gone ahead and added typings for cy.takeSnapshot(), upgrade @chromatic-com/cypress to version 0.6.8 or higher to take advantage of that!

snake-py commented 1 month ago

@skitterm I am unusre but we still have this issue on the 0.6.17, is there more to it then just installing it?

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",

    /* Linting */
    "strict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noFallthroughCasesInSwitch": true,

    "baseUrl": "./",
    "paths": {
      "#/*": ["./src/*"],
      "#Apps/*": ["./src/Apps/*"],
      "#JourneyComponents/*": ["./src/Apps/Journey/UI/components/*"],
      "#WidgetComponents/*": ["./src/Apps/Widget/UI/components/*"],
      "#SharedComponents/*": ["./src/components/*"],
      "#JourneySteps/*": ["./src/Apps/Journey/UI/steps/*"],
      "#WidgetSteps/*": ["./src/Apps/Widget/UI/steps/*"],
      "#configs/*": ["./src/configs/*"],
      "#hooks/*": ["./src/hooks/*"],
      "#api/*": ["./src/api/*"],
      "#types/*": ["./src/types/*"],
      "#utils/*": ["./src/utils/*"],
      "#state/*": ["./src/state/*"],
      "#i18n/*": ["./src/i18n/*"]
    }
  },
  "include": ["src", "client-themes/themes"],
  "references": [{ "path": "./tsconfig.node.json" }],
  "exclude": ["src/tests/e2e/downloads"]
}