index.ts 929 B

12345678910111213141516171819202122232425
  1. import '@testing-library/cypress/add-commands'
  2. import { interceptCompile } from './compile'
  3. import { interceptEvents } from './events'
  4. import { interceptSpelling } from './spelling'
  5. // eslint-disable-next-line no-unused-vars,@typescript-eslint/no-namespace
  6. declare global {
  7. // eslint-disable-next-line @typescript-eslint/no-namespace,no-unused-vars
  8. namespace Cypress {
  9. // eslint-disable-next-line no-unused-vars
  10. interface Chainable {
  11. interceptCompile: typeof interceptCompile
  12. interceptEvents: typeof interceptEvents
  13. interceptSpelling: typeof interceptSpelling
  14. index: () => Chainable<number>
  15. }
  16. }
  17. }
  18. Cypress.Commands.add('interceptCompile', interceptCompile)
  19. Cypress.Commands.add('interceptEvents', interceptEvents)
  20. Cypress.Commands.add('interceptSpelling', interceptSpelling)
  21. Cypress.Commands.add('index', { prevSubject: true }, subject => {
  22. return cy.wrap(subject).invoke('index')
  23. })