Skip to content

DayJS throwing TS2339 error #19502

Answered by Zhen-Bo
Zach-Costa asked this question in Plugins
Dec 30, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

create a cypress-global-vars.d.ts in your support folder
cypress-global-vars.d.ts file:

/// <reference types="cypress" />

import dayjs from 'dayjs';

declare global {
  namespace Cypress {
    interface Cypress {
      dayjs: dayjs.Dayjs;
    }
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zach-Costa
Comment options

Answer selected by Zach-Costa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants